Explorar el Código

fixed memory leak: triangulated (cppcheck)

Simon Wenner hace 10 años
padre
commit
332d9af81b
Se han modificado 1 ficheros con 1 adiciones y 0 borrados
  1. 1 0
      drivers/convex_decomp/b2Polygon.cpp

+ 1 - 0
drivers/convex_decomp/b2Polygon.cpp

@@ -970,6 +970,7 @@ int32 DecomposeConvex(b2Polygon* p, b2Polygon* results, int32 maxPolys) {
 		}
 		if (nTri < 1) {
             //Still no luck?  Oh well...
+            delete[] triangulated;
             return -1;
         }
         int32 nPolys = PolygonizeTriangles(triangulated, nTri, results, maxPolys);