mirror of https://github.com/axmolengine/axmol.git
Merge pull request #910 from dumganhar/iss1253_purgeConfig
fixed #1253: Added static method "purgeConfiguration" for CCConfiguration to avoid memory leak.
This commit is contained in:
commit
aae5d881fc
|
@ -104,6 +104,11 @@ CCConfiguration* CCConfiguration::sharedConfiguration(void)
|
|||
return s_gSharedConfiguration;
|
||||
}
|
||||
|
||||
void CCConfiguration::purgeConfiguration(void)
|
||||
{
|
||||
CC_SAFE_RELEASE_NULL(s_gSharedConfiguration);
|
||||
}
|
||||
|
||||
bool CCConfiguration::checkForGLExtension(const string &searchName)
|
||||
{
|
||||
bool bRet = false;
|
||||
|
|
|
@ -39,9 +39,10 @@ NS_CC_BEGIN
|
|||
class CC_DLL CCConfiguration : public CCObject
|
||||
{
|
||||
public:
|
||||
/** returns a shared instance of the CCConfiguration */
|
||||
/** returns a shared instance of CCConfiguration */
|
||||
static CCConfiguration *sharedConfiguration(void);
|
||||
|
||||
/** purge the shared instance of CCConfiguration */
|
||||
static void purgeConfiguration(void);
|
||||
public:
|
||||
|
||||
/** OpenGL Max texture size. */
|
||||
|
|
|
@ -583,10 +583,11 @@ void CCDirector::purgeDirector()
|
|||
|
||||
// purge all managers / caches
|
||||
CCAnimationCache::purgeSharedAnimationCache();
|
||||
CCSpriteFrameCache::purgeSharedSpriteFrameCache();
|
||||
CCSpriteFrameCache::purgeSharedSpriteFrameCache();
|
||||
CCTextureCache::purgeSharedTextureCache();
|
||||
CCShaderCache::purgeSharedShaderCache();
|
||||
|
||||
CCConfiguration::purgeConfiguration();
|
||||
|
||||
// cocos2d-x specific data structures
|
||||
CCUserDefault::purgeSharedUserDefault();
|
||||
extension::CCNotificationCenter::purgeNotificationCenter();
|
||||
|
|
Loading…
Reference in New Issue