mirror of https://github.com/axmolengine/axmol.git
fixes double free crash on GLProgramStateCache
This commit is contained in:
parent
029c38a789
commit
605fe8e4f3
|
@ -33,16 +33,11 @@ GLProgramStateCache* GLProgramStateCache::s_instance = nullptr;
|
|||
|
||||
GLProgramStateCache::GLProgramStateCache()
|
||||
{
|
||||
s_instance = nullptr;
|
||||
}
|
||||
|
||||
GLProgramStateCache::~GLProgramStateCache()
|
||||
{
|
||||
for (auto itr = _glProgramStates.begin(); itr != _glProgramStates.end(); itr++) {
|
||||
itr->second->release();
|
||||
}
|
||||
_glProgramStates.clear();
|
||||
s_instance = nullptr;
|
||||
}
|
||||
|
||||
GLProgramStateCache* GLProgramStateCache::getInstance()
|
||||
|
|
Loading…
Reference in New Issue