diff --git a/examples/Importers/ImportSTLDemo/LoadMeshFromSTL.h b/examples/Importers/ImportSTLDemo/LoadMeshFromSTL.h index 95cd93ef3..78d386731 100644 --- a/examples/Importers/ImportSTLDemo/LoadMeshFromSTL.h +++ b/examples/Importers/ImportSTLDemo/LoadMeshFromSTL.h @@ -46,6 +46,7 @@ static GLInstanceGraphicsShape* LoadMeshFromSTL(const char* relativeFileName) int expectedBinaryFileSize = numTriangles* 50 + 84; if (expectedBinaryFileSize != size) { + delete[] memoryBuffer; return 0; } diff --git a/examples/SharedMemory/PhysicsServerCommandProcessor.cpp b/examples/SharedMemory/PhysicsServerCommandProcessor.cpp index 46bd40a31..bfd6bc804 100644 --- a/examples/SharedMemory/PhysicsServerCommandProcessor.cpp +++ b/examples/SharedMemory/PhysicsServerCommandProcessor.cpp @@ -376,7 +376,8 @@ struct MyBroadphaseCallback : public btBroadphaseAabbCallback if (bodyUniqueId >= 0) { m_bodyUniqueIds.push_back(bodyUniqueId); - m_links.push_back(mbl->m_link); + //it is not a multibody, so use -1 otherwise + m_links.push_back(-1); } return true; }