diff options
author | Joerg Mueller <nexyon@gmail.com> | 2012-02-07 15:22:50 +0400 |
---|---|---|
committer | Joerg Mueller <nexyon@gmail.com> | 2012-02-07 15:22:50 +0400 |
commit | 77ab18ebc345d670c65a4f5d2aa65c6aa6d13414 (patch) | |
tree | 136937fd8b4aaec3bfe033d6d2372708d7d88ce1 | |
parent | 72889d8935b84ee3952ebac721f8840eb75e981d (diff) |
Fix for [#29910] Crash on reading KX_SoundActuator.sound
aud is now imported automatically on BGE start.
-rw-r--r-- | source/gameengine/Ketsji/KX_PythonInit.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/source/gameengine/Ketsji/KX_PythonInit.cpp b/source/gameengine/Ketsji/KX_PythonInit.cpp index 82084700d6c..401474b21a9 100644 --- a/source/gameengine/Ketsji/KX_PythonInit.cpp +++ b/source/gameengine/Ketsji/KX_PythonInit.cpp @@ -1880,6 +1880,14 @@ PyObject* initGamePlayerPythonScripting(const STR_String& progname, TPythonSecur Py_DECREF(mod); } +#ifdef WITH_AUDASPACE + /* accessing a SoundActuator's sound results in a crash if aud is not initialised... */ + { + PyObject *mod= PyImport_ImportModuleLevel((char *)"aud", NULL, NULL, NULL, 0); + Py_DECREF(mod); + } +#endif + initPyTypes(); bpy_import_main_set(maggie); @@ -1924,6 +1932,14 @@ PyObject* initGamePythonScripting(const STR_String& progname, TPythonSecurityLev Py_NoSiteFlag=1; Py_FrozenFlag=1; +#ifdef WITH_AUDASPACE + /* accessing a SoundActuator's sound results in a crash if aud is not initialised... */ + { + PyObject *mod= PyImport_ImportModuleLevel((char *)"aud", NULL, NULL, NULL, 0); + Py_DECREF(mod); + } +#endif + initPyTypes(); bpy_import_main_set(maggie); |