jstier at cs.uvic.ca
Thu Sep 29 01:15:56 CEST 2005
I have a problem with the reference count after an error occurs
in a script which I execute as follows..
PyObject* lDict = PyDict_New();
PyDict_SetItemString(lDict, "item", (PyObject*)iItem->mPyObject);
PyObject* lResult = PyEval_EvalCode(mCode, ScnGlobal::sDictionary,
if (! lResult)
The script within the mCode object only contains the following line,
which generates an error.
The problem is that after PyEval_EvalCode returns the reference count
for lDict is one larger than before. Py_DECREF(lDict) does
therefore not delete the Dictionary, which causes me problems. Is
Python keeping an exception around. I assume that I have to do some
more cleanup ??
More information about the Python-list