diff options
author | Porteries Tristan <republicthunderbolt9@gmail.com> | 2015-08-20 12:53:09 +0300 |
---|---|---|
committer | Porteries Tristan <republicthunderbolt9@gmail.com> | 2015-08-20 13:06:54 +0300 |
commit | cd24871706411b2afd6e098e2b7c95c94bc2de38 (patch) | |
tree | 48903e72b844662d45e482e48e549ab35231eb7d /source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp | |
parent | f4d8ce97810476d0f0bf27809ab411081f0042f8 (diff) |
BGE: Fix T44557 GameLogic module memory leak.
This reverts commit 7a28ca4398465be1d6d57079e4b27c3a03418745.
Diffstat (limited to 'source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp')
-rw-r--r-- | source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp | 19 |
1 files changed, 4 insertions, 15 deletions
diff --git a/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp b/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp index dcdc5463b04..4e07af9f3d8 100644 --- a/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp +++ b/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp @@ -584,22 +584,11 @@ extern "C" void StartKetsjiShell(struct bContext *C, struct ARegion *ar, rcti *c // inside the GameLogic dictionary when the python interpreter is finalized. // which allows the scene to safely delete them :) // see: (space.c)->start_game - - //PyDict_Clear(PyModule_GetDict(gameLogic)); - - // Keep original items, means python plugins will autocomplete members - PyObject *gameLogic_keys_new = PyDict_Keys(PyModule_GetDict(gameLogic)); - const Py_ssize_t numitems= PyList_GET_SIZE(gameLogic_keys_new); - Py_ssize_t listIndex; - for (listIndex=0; listIndex < numitems; listIndex++) { - PyObject *item = PyList_GET_ITEM(gameLogic_keys_new, listIndex); - if (!PySequence_Contains(gameLogic_keys, item)) { - PyDict_DelItem( PyModule_GetDict(gameLogic), item); - } - } - Py_DECREF(gameLogic_keys_new); - gameLogic_keys_new = NULL; + + PyDict_Clear(PyModule_GetDict(gameLogic)); + PyDict_SetItemString(PyModule_GetDict(gameLogic), "globalDict", pyGlobalDict); #endif + ketsjiengine->StopEngine(); #ifdef WITH_PYTHON exitGamePythonScripting(); |