I use push scene to show my options menu like so:
CCDirector::sharedDirector()->pushScene(SceneGameOptions::scene());
Once my “options menu” scene is loaded, if I exit the win-32 application by clicking the X to close the window, I get an unhandled esception.
This only happens when I close the program while I am in a pushed scene.
The program crashes in the CCScheduler.cpp here
void CCScheduler::removeUpdateFromHash(struct _listEntry *entry)
{
tHashUpdateEntry *element = NULL;
HASH_FIND_INT(m_pHashForUpdates, &entry->target, element);
if (element)
{
// list entry
DL_DELETE(*element->list, element->entry);
free(element->entry);
// hash entry
element->target->selectorProtocolRelease(); ////CRASHES ON THIS LINE/////
HASH_DEL(m_pHashForUpdates, element);
free(element);
}
}
this is the error in the output:
First-chance exception at 0x56b56ab4 (libcocos2d.dll) in SiftHeads.win32.exe: 0xC0000005: Access violation reading location 0xfeeeff0e.
Unhandled exception at 0x56b56ab4 (libcocos2d.dll) in SiftHeads.win32.exe: 0xC0000005: Access violation reading location 0xfeeeff0e.
If i pop back to the first scene before exiting. All is well.