diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-03-26 11:13:42 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-03-26 11:13:42 +0300 |
commit | 02a7063a0922c6c59a9f71ea2627e4f211a79899 (patch) | |
tree | 230ed5a6652bbd3ac16d4bb060d451301395c7fd /source/gameengine/GamePlayer | |
parent | d53a0cd48f5e9293a9e08252d261c830c34f532c (diff) |
fix for blenderplayer crashing on exit.
the event consumer was being freed twice, once when going out of C++ scope, another when freeing the system.
Diffstat (limited to 'source/gameengine/GamePlayer')
-rw-r--r-- | source/gameengine/GamePlayer/ghost/GPG_ghost.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp b/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp index 65a68f1bac3..968d6caeb1c 100644 --- a/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp +++ b/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp @@ -939,6 +939,10 @@ int main(int argc, char** argv) } app.StopGameEngine(); + /* 'app' is freed automatic when out of scope. + * removal is needed else the system will free an already freed value */ + system->removeEventConsumer(&app); + BLO_blendfiledata_free(bfd); } } while (exitcode == KX_EXIT_REQUEST_RESTART_GAME || exitcode == KX_EXIT_REQUEST_START_OTHER_GAME); |