More example code is memory-leak free now, in particular PhysicsServerExample.
/PhysicsServerCommandProcessor also fixed some memory issue in InverseDynamicsExample (the base class is supposed to delete collision shape memory)
This commit is contained in:
@@ -21,6 +21,7 @@ void GraphingTexture::destroy()
|
||||
m_height=0;
|
||||
glDeleteTextures(1,(GLuint*)&m_textureId);
|
||||
m_textureId=0;
|
||||
|
||||
}
|
||||
|
||||
bool GraphingTexture::create(int texWidth, int texHeight)
|
||||
|
||||
@@ -675,7 +675,10 @@ struct QuickCanvas : public Common2dCanvasInterface
|
||||
virtual void destroyCanvas(int canvasId)
|
||||
{
|
||||
btAssert(canvasId>=0);
|
||||
delete m_gt[canvasId];
|
||||
m_gt[canvasId] = 0;
|
||||
destroyTextureWindow(m_gw[canvasId]);
|
||||
m_gw[canvasId] = 0;
|
||||
m_curNumGraphWindows--;
|
||||
}
|
||||
virtual void setPixel(int canvasId, int x, int y, unsigned char red, unsigned char green,unsigned char blue, unsigned char alpha)
|
||||
@@ -745,6 +748,7 @@ OpenGLExampleBrowser::~OpenGLExampleBrowser()
|
||||
|
||||
delete m_internalData;
|
||||
|
||||
gFileImporterByExtension.clear();
|
||||
gAllExamples = 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
#include "../Importers/ImportURDFDemo/ImportURDFSetup.h"
|
||||
#include "../Importers/ImportSDFDemo/ImportSDFSetup.h"
|
||||
#include "../Importers/ImportSTLDemo/ImportSTLSetup.h"
|
||||
|
||||
#include "LinearMath/btAlignedAllocator.h"
|
||||
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
@@ -49,5 +49,11 @@ int main(int argc, char* argv[])
|
||||
delete exampleBrowser;
|
||||
|
||||
}
|
||||
|
||||
//#ifdef BT_DEBUG_MEMORY_ALLOCATIONS
|
||||
int numBytesLeaked = btDumpMemoryLeaks();
|
||||
btAssert(numBytesLeaked==0);
|
||||
//#endif//BT_DEBUG_MEMORY_ALLOCATIONS
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user