Fixed memory leaks in ConvexDecomposition and ColladaConverter libraries

Added ConvexDecompositionDemo to CMake build
This commit is contained in:
john.mccutchan
2008-08-28 17:36:50 +00:00
parent 5fd1a69f32
commit 32bf51aa47
9 changed files with 89 additions and 26 deletions

View File

@@ -150,7 +150,10 @@ CHull * ConvexBuilder::canMerge(CHull *a,CHull *b)
//don't do anything if hull is empty
if (!tcount)
{
Vl_releaseVertexLookup (vc);
return 0;
}
HullResult hresult;
HullLibrary hl;
@@ -323,6 +326,8 @@ unsigned int ConvexBuilder::process(const DecompDesc &desc)
mCallback->ConvexDecompResult(r);
}
hl.ReleaseResult (result);
delete cr;
}

View File

@@ -204,6 +204,7 @@ void calcConvexDecomposition(unsigned int vcount,
}
#endif
hl.ReleaseResult (result);
return;
}

View File

@@ -816,8 +816,8 @@ WavefrontObj::WavefrontObj(void)
WavefrontObj::~WavefrontObj(void)
{
delete mIndices;
delete mVertices;
delete [] mIndices;
delete [] mVertices;
}
unsigned int WavefrontObj::loadObj(const char *fname) // load a wavefront obj returns number of triangles that were loaded. Data is persists until the class is destructed.
@@ -825,9 +825,9 @@ unsigned int WavefrontObj::loadObj(const char *fname) // load a wavefront obj re
unsigned int ret = 0;
delete mVertices;
delete [] mVertices;
mVertices = 0;
delete mIndices;
delete [] mIndices;
mIndices = 0;
mVertexCount = 0;
mTriCount = 0;