- fix for python refcounting crashes, remember PyDict_GetItem and PyDict_GetItemString borrow a ref.

- the namespace dictionary wasn't being de-allocated for each run.
- clear every error after printing it to avoid stale PyObjects hanging about.
This commit is contained in:
2009-04-23 09:15:42 +00:00
parent 0a12af1f8e
commit e948fe3078
3 changed files with 19 additions and 24 deletions

View File

@@ -344,7 +344,7 @@ static PyObject *Method_registerKey( PyObject * self, PyObject * args )
static bContext *get_py_context__internal(void)
{
PyObject *globals = PyEval_GetGlobals();
PyObject *val= PyDict_GetItemString(globals, "__bpy_context__");
PyObject *val= PyDict_GetItemString(globals, "__bpy_context__"); /* borrow ref */
return PyCObject_AsVoidPtr(val);
}