fix for 2 memory leaks in dualcon library, quite bad since they leaked on every evalu...
authorCampbell Barton <ideasman42@gmail.com>
Sun, 4 Aug 2013 18:05:29 +0000 (18:05 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Sun, 4 Aug 2013 18:05:29 +0000 (18:05 +0000)
intern/dualcon/intern/octree.cpp

index 6567b2873a2ddb721f7f29aabfdc612ef9e0d04e..3ba396b940d19e32304ffd81ebaf32831e9ce989 100644 (file)
@@ -106,6 +106,7 @@ Octree::Octree(ModelReader *mr,
 
 Octree::~Octree()
 {
+       delete cubes;
        freeMemory();
 }
 
@@ -1910,11 +1911,13 @@ int Octree::floodFill(LeafNode *leaf, int st[3], int len, int height, int thresh
                                        maxtotal = total;
                                }
                                dc_printf(".\n");
+                               delete queue;
                                continue;
                        }
 
                        if (total >= threshold) {
                                dc_printf("Maintained.\n");
+                               delete queue;
                                continue;
                        }
                        dc_printf("Less then %d, removing...\n", threshold);
@@ -2001,6 +2004,8 @@ int Octree::floodFill(LeafNode *leaf, int st[3], int len, int height, int thresh
                                        }
                                }
                        }
+
+                       delete queue;
                }
        }