issue #6: autorelease pool management

This commit is contained in:
Ming 2010-08-02 09:48:01 +00:00
parent 8e496d09d9
commit 3b2425d8bf
1 changed files with 7 additions and 0 deletions

View File

@ -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;
}