diff options
author | Daniel Stokes <kupomail@gmail.com> | 2013-07-20 07:01:50 +0400 |
---|---|---|
committer | Daniel Stokes <kupomail@gmail.com> | 2013-07-20 07:01:50 +0400 |
commit | ff165fa986a922346723b2a775d234db13d22afd (patch) | |
tree | 794861983734bbf17c026ee36c1ad5280f68a057 /source/gameengine/GamePlayer | |
parent | 65b932d9f1ba21a569a15ef3fd167b8ff43f521c (diff) |
Re fixing BGE bug [#36223] Strange page fault of "Game" actuator
Thanks to Campbell for helping me get a better fix put together.
Diffstat (limited to 'source/gameengine/GamePlayer')
-rw-r--r-- | source/gameengine/GamePlayer/ghost/GPG_ghost.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp b/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp index 2c642d4bd04..f1edb71f4fe 100644 --- a/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp +++ b/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp @@ -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(); |