mirror of
https://github.com/opencv/opencv.git
synced 2025-06-07 17:44:04 +08:00
Fix a leak described in issue #11205
This commit is contained in:
parent
6ffc48769a
commit
eae3ed0c08
@ -1584,6 +1584,8 @@ static void OnChange(int pos, void *param)
|
|||||||
PyObject *r = PyObject_Call(PyTuple_GetItem(o, 0), args, NULL);
|
PyObject *r = PyObject_Call(PyTuple_GetItem(o, 0), args, NULL);
|
||||||
if (r == NULL)
|
if (r == NULL)
|
||||||
PyErr_Print();
|
PyErr_Print();
|
||||||
|
else
|
||||||
|
Py_DECREF(r);
|
||||||
Py_DECREF(args);
|
Py_DECREF(args);
|
||||||
PyGILState_Release(gstate);
|
PyGILState_Release(gstate);
|
||||||
}
|
}
|
||||||
@ -1626,6 +1628,8 @@ static void OnButtonChange(int state, void *param)
|
|||||||
PyObject *r = PyObject_Call(PyTuple_GetItem(o, 0), args, NULL);
|
PyObject *r = PyObject_Call(PyTuple_GetItem(o, 0), args, NULL);
|
||||||
if (r == NULL)
|
if (r == NULL)
|
||||||
PyErr_Print();
|
PyErr_Print();
|
||||||
|
else
|
||||||
|
Py_DECREF(r);
|
||||||
Py_DECREF(args);
|
Py_DECREF(args);
|
||||||
PyGILState_Release(gstate);
|
PyGILState_Release(gstate);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user