CCDirect_mobile.cpp crash m_bPurgeDirecotorInNextLoop

for: “fixed #306, invoke CCDirector::end() method in next msgloop, otherwise the flow will crashes when end() is called in an ActionInterval.”
m_bPurgeDirecotorInNextLoop was added, however, after CCDirector::purgeDirector is called, m_bPurgeDirecotorInNextLoop is not set back to false which causes another entrance to CCDirector::purgeDirector, which is not NULL safe for m_pRunningScene. I recommend this change:

void CCDisplayLinkDirector::mainLoop(void)
{
if (m_bPurgeDirecotorInNextLoop)
{
purgeDirector();
m_bPurgeDirecotorInNextLoop = false;
}

}

or add NULL checking to m_pRunningScene in CCDirector::purgeDirector.
or both :slight_smile:

Well, you are right. Thanks.
I fix this bug in this commit, using both check of them