Fixed segfault

The pattern was deleted for each trapezoid => double free