Skip to content
Snippets Groups Projects
Commit 304018b9 authored by David Gobbi's avatar David Gobbi
Browse files

Fix memory leak for Python reference parameters

The docs for PyVTKReference say that PyVTKReference_SetValue(self, o)
steals the reference for 'o', but that is not how it was implemented.
This commit fixes the implementation so that it matches the docs.
parent 183deb78
No related branches found
No related tags found
No related merge requests found
......@@ -172,6 +172,7 @@ int PyVTKReference_SetValue(PyObject* self, PyObject* val)
PyObject** op = &((PyVTKReference*)self)->value;
PyObject* result = PyVTKReference_CompatibleObject(self, val);
Py_DECREF(val);
if (result)
{
Py_DECREF(*op);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment