Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDiego Borghetti <bdiego@gmail.com>2008-08-13 22:29:13 +0400
committerDiego Borghetti <bdiego@gmail.com>2008-08-13 22:29:13 +0400
commitb5cd4739d8aa9256eed6a8b6c057fc0e2b73b2d1 (patch)
treec66fcbeab88474dd8a47a6d40fb9af6fb6e3eb62 /source/gameengine
parentc8e22c3a6b2d8c7678f7054a5d5afa7852fa1c51 (diff)
branches/blender-2.47
Merge from trunk: Revision: 16075 Revision: 16081
Diffstat (limited to 'source/gameengine')
-rw-r--r--source/gameengine/GameLogic/SCA_PythonController.cpp31
1 files changed, 8 insertions, 23 deletions
diff --git a/source/gameengine/GameLogic/SCA_PythonController.cpp b/source/gameengine/GameLogic/SCA_PythonController.cpp
index 01ae4072335..cd1b029fc34 100644
--- a/source/gameengine/GameLogic/SCA_PythonController.cpp
+++ b/source/gameengine/GameLogic/SCA_PythonController.cpp
@@ -273,36 +273,16 @@ void SCA_PythonController::Trigger(SCA_LogicManager* logicmgr)
* break it by hand, then DECREF (which in this case
* should always ensure excdict is cleared).
*/
-/* PyObject *excdict= myPyDict_Copy(m_pythondictionary);
- struct _object* resultobj = PyEval_EvalCode((PyCodeObject*)m_bytecode,
- excdict,
- excdict
- );
- PyDict_Clear(excdict);
- Py_DECREF(excdict);*/
-
-#if 1
PyObject *excdict= PyDict_Copy(m_pythondictionary);
PyObject* resultobj = PyEval_EvalCode((PyCodeObject*)m_bytecode,
- excdict,
- excdict
- );
- PyDict_Clear(excdict);
- Py_DECREF(excdict);
-#else
-
- PyObject* resultobj = PyEval_EvalCode((PyCodeObject*)m_bytecode,
- m_pythondictionary,
- m_pythondictionary
- );
-
-#endif
+ excdict, excdict);
if (resultobj)
{
Py_DECREF(resultobj);
- } else
+ }
+ else
{
// something is wrong, tell the user what went wrong
printf("PYTHON SCRIPT ERROR:\n");
@@ -310,6 +290,11 @@ void SCA_PythonController::Trigger(SCA_LogicManager* logicmgr)
//PyRun_SimpleString(m_scriptText.Ptr());
}
+ // clear after PyErrPrint - seems it can be using
+ // something in this dictionary and crash?
+ PyDict_Clear(excdict);
+ Py_DECREF(excdict);
+
m_sCurrentController = NULL;
}