Fix some leaking when switching resolution

This commit is contained in:
Benau 2018-01-07 14:58:32 +08:00
parent 157faaf616
commit 262337bc13
2 changed files with 7 additions and 5 deletions

View File

@ -156,10 +156,6 @@ IrrDriver::~IrrDriver()
#ifdef ENABLE_RECORDER #ifdef ENABLE_RECORDER
ogrDestroy(); ogrDestroy();
#endif #endif
assert(m_device != NULL);
m_device->drop();
m_device = NULL;
m_modes.clear();
STKTexManager::getInstance()->kill(); STKTexManager::getInstance()->kill();
#ifndef SERVER_ONLY #ifndef SERVER_ONLY
if (CVS->isGLSL()) if (CVS->isGLSL())
@ -169,6 +165,10 @@ IrrDriver::~IrrDriver()
#endif #endif
delete m_wind; delete m_wind;
delete m_renderer; delete m_renderer;
assert(m_device != NULL);
m_device->drop();
m_device = NULL;
m_modes.clear();
} // ~IrrDriver } // ~IrrDriver
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------

View File

@ -969,12 +969,14 @@ void destroy()
return; return;
} }
SPTextureManager::destroy(); g_dy_dc.clear();
for (auto& p : g_shaders) for (auto& p : g_shaders)
{ {
delete p.second; delete p.second;
} }
g_shaders.clear(); g_shaders.clear();
SPTextureManager::destroy();
#ifndef SERVER_ONLY #ifndef SERVER_ONLY
#ifndef USE_GLES2 #ifndef USE_GLES2