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

View File

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