mirror of https://github.com/axmolengine/axmol.git
Merge pull request #10817 from garfieldkwong/fix_autorelease_branch
fix issue autorelease will not release trigger by autorelease.
This commit is contained in:
commit
2ea88a30bb
|
@ -65,11 +65,12 @@ void AutoreleasePool::clear()
|
||||||
#if defined(COCOS2D_DEBUG) && (COCOS2D_DEBUG > 0)
|
#if defined(COCOS2D_DEBUG) && (COCOS2D_DEBUG > 0)
|
||||||
_isClearing = true;
|
_isClearing = true;
|
||||||
#endif
|
#endif
|
||||||
for (const auto &obj : _managedObjectArray)
|
std::vector<Ref*> releasings;
|
||||||
|
releasings.swap(_managedObjectArray);
|
||||||
|
for (const auto &obj : releasings)
|
||||||
{
|
{
|
||||||
obj->release();
|
obj->release();
|
||||||
}
|
}
|
||||||
_managedObjectArray.clear();
|
|
||||||
#if defined(COCOS2D_DEBUG) && (COCOS2D_DEBUG > 0)
|
#if defined(COCOS2D_DEBUG) && (COCOS2D_DEBUG > 0)
|
||||||
_isClearing = false;
|
_isClearing = false;
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue