//
// cocos2d::CCDirector::purgeDirector from 0x5c38ba to 0x5c398c (210 bytes)
//
// 1 xrefs:
// > cocos2d::CCDisplayLinkDirector::mainLoop @ 0x5c3c2e
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
void cocos2d::CCDirector::purgeDirector(cocos2d::CCDirector *a1)
{
cocos2d::CCScheduler *v2; // r0
cocos2d::_ccArray *v3; // r1
cocos2d::CCScene *m_pRunningScene; // r0
cocos2d::CCArray *m_pobScenesStack; // r0
cocos2d::CCLabelAtlas *m_pFPSLabel; // r0
cocos2d::CCLabelAtlas *m_pSPFLabel; // r0
cocos2d::CCLabelAtlas *m_pDrawsLabel; // r0
v2 = a1->getScheduler(a1);
cocos2d::CCScheduler::unscheduleAll(v2);
cocos2d::CCTouchDispatcher::removeAllDelegates(a1->m_pTouchDispatcher);
m_pRunningScene = a1->m_pRunningScene;
if ( m_pRunningScene )
{
m_pRunningScene->onExitTransitionDidStart(m_pRunningScene);
a1->m_pRunningScene->onExit(a1->m_pRunningScene);
a1->m_pRunningScene->cleanup(a1->m_pRunningScene);
cocos2d::CCObject::release(a1->m_pRunningScene);
}
m_pobScenesStack = a1->m_pobScenesStack;
a1->m_pRunningScene = nullptr;
a1->m_pNextScene = nullptr;
a1->m_pSceneReference = nullptr;
cocos2d::CCArray::removeAllObjects(m_pobScenesStack, v3);
a1->stopAnimation(a1);
m_pFPSLabel = a1->m_pFPSLabel;
if ( m_pFPSLabel )
{
cocos2d::CCObject::release(m_pFPSLabel);
a1->m_pFPSLabel = nullptr;
}
m_pSPFLabel = a1->m_pSPFLabel;
if ( m_pSPFLabel )
{
cocos2d::CCObject::release(m_pSPFLabel);
a1->m_pSPFLabel = nullptr;
}
m_pDrawsLabel = a1->m_pDrawsLabel;
if ( m_pDrawsLabel )
{
cocos2d::CCObject::release(m_pDrawsLabel);
a1->m_pDrawsLabel = nullptr;
}
cocos2d::CCLabelBMFont::purgeCachedData();
cocos2d::ccDrawFree();
cocos2d::CCAnimationCache::purgeSharedAnimationCache();
cocos2d::CCSpriteFrameCache::purgeSharedSpriteFrameCache();
cocos2d::CCTextureCache::purgeSharedTextureCache();
cocos2d::CCShaderCache::purgeSharedShaderCache();
cocos2d::CCFileUtils::purgeFileUtils();
cocos2d::CCConfiguration::purgeConfiguration();
cocos2d::CCUserDefault::purgeSharedUserDefault();
cocos2d::CCNotificationCenter::purgeNotificationCenter();
cocos2d::ccGLInvalidateStateCache();
a1->m_pobOpenGLView->end(a1->m_pobOpenGLView);
a1->m_pobOpenGLView = nullptr;
cocos2d::CCObject::release(a1);
}