mirror of https://github.com/axmolengine/axmol.git
issue #6: autorelease pool management
This commit is contained in:
parent
8e496d09d9
commit
3b2425d8bf
|
@ -35,6 +35,7 @@ THE SOFTWARE.
|
|||
#include "CCTextureCache.h"
|
||||
#include "CCTransition.h"
|
||||
#include "CCSpriteFrameCache.h"
|
||||
#include "cocoa/NSAutoreleasePool.h"
|
||||
|
||||
#include <string>
|
||||
|
||||
|
@ -129,6 +130,9 @@ CCDirector* CCDirector::init(void)
|
|||
m_fContentScaleFactor = 1;
|
||||
m_obScreenSize = m_obSurfaceSize = CGSizeZero;
|
||||
|
||||
// create autorelease pool
|
||||
NSPoolManager::getInstance()->push();
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
|
@ -144,6 +148,9 @@ CCDirector::~CCDirector(void)
|
|||
m_pRunningScene->release();
|
||||
m_pobScenesStack->release();
|
||||
|
||||
// pop the autorelease pool
|
||||
NSPoolManager::getInstance()->pop();
|
||||
|
||||
pobSharedDirector = NULL;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue