Remove memory leak in SimpleOpenGL3 example code
This commit is contained in:
@@ -650,9 +650,13 @@ void SimpleOpenGL3App::setBackgroundColor(float red, float green, float blue)
|
|||||||
|
|
||||||
SimpleOpenGL3App::~SimpleOpenGL3App()
|
SimpleOpenGL3App::~SimpleOpenGL3App()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
delete m_instancingRenderer;
|
||||||
delete m_primRenderer ;
|
delete m_primRenderer ;
|
||||||
|
sth_delete(m_data->m_fontStash);
|
||||||
|
delete m_data->m_renderCallbacks;
|
||||||
m_window->closeWindow();
|
m_window->closeWindow();
|
||||||
|
TwDeleteDefaultFonts();
|
||||||
delete m_window;
|
delete m_window;
|
||||||
delete m_data ;
|
delete m_data ;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
|
||||||
#include "OpenGLWindow/SimpleOpenGL3App.h"
|
#include "OpenGLWindow/SimpleOpenGL3App.h"
|
||||||
#include "Bullet3Common/b3Quaternion.h"
|
#include "Bullet3Common/b3Quaternion.h"
|
||||||
#include "Bullet3Common/b3CommandLineArgs.h"
|
#include "Bullet3Common/b3CommandLineArgs.h"
|
||||||
@@ -78,7 +79,7 @@ int main(int argc, char* argv[])
|
|||||||
app->m_window->setResizeCallback(MyResizeCallback);
|
app->m_window->setResizeCallback(MyResizeCallback);
|
||||||
|
|
||||||
|
|
||||||
myArgs.GetCmdLineArgument("mp4_file",gVideoFileName);
|
myArgs.GetCmdLineArgument("mp4_file",gVideoFileName);
|
||||||
if (gVideoFileName)
|
if (gVideoFileName)
|
||||||
app->dumpFramesToVideo(gVideoFileName);
|
app->dumpFramesToVideo(gVideoFileName);
|
||||||
|
|
||||||
@@ -150,6 +151,9 @@ int main(int argc, char* argv[])
|
|||||||
} while (!app->m_window->requestedExit());
|
} while (!app->m_window->requestedExit());
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
delete app;
|
delete app;
|
||||||
|
|
||||||
|
delete[] image;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user