Re fixing BGE bug [#36223] Strange page fault of "Game" actuator

Thanks to Campbell for helping me get a better fix put together.
This commit is contained in:
Daniel Stokes 2013-07-20 03:01:50 +00:00
parent 65b932d9f1
commit ff165fa986

@ -1031,10 +1031,9 @@ int main(int argc, char** argv)
* removal is needed else the system will free an already freed value */
system->removeEventConsumer(&app);
/* nodesystem relies on blendfile data, free it first */
free_nodesystem();
BLO_blendfiledata_free(bfd);
/* G.main == bfd->main, it gets referenced in free_nodesystem so we can't have a dangling pointer */
G.main = NULL;
if (python_main) MEM_freeN(python_main);
}
} while (exitcode == KX_EXIT_REQUEST_RESTART_GAME || exitcode == KX_EXIT_REQUEST_START_OTHER_GAME);
@ -1052,6 +1051,13 @@ int main(int argc, char** argv)
}
}
/* refer to WM_exit_ext() and free_blender(),
* these are not called in the player but we need to match some of there behavior here,
* if the order of function calls or blenders state isn't matching that of blender proper,
* we may get troubles later on */
free_nodesystem();
// Cleanup
RNA_exit();
BLF_exit();