Fix T71680: _PyObject_LookupAttr memory leak

This commit is contained in:
2019-11-20 17:53:22 +11:00
parent 9d8af29267
commit 43eb34ec81

View File

@@ -8688,6 +8688,7 @@ static PyObject *pyrna_register_class(PyObject *UNUSED(self), PyObject *py_class
switch (_PyObject_LookupAttr(py_class, bpy_intern_str_register, &py_cls_meth)) {
case 1: {
PyObject *ret = PyObject_CallObject(py_cls_meth, NULL);
Py_DECREF(py_cls_meth);
if (ret) {
Py_DECREF(ret);
}
@@ -8794,6 +8795,7 @@ static PyObject *pyrna_unregister_class(PyObject *UNUSED(self), PyObject *py_cla
switch (_PyObject_LookupAttr(py_class, bpy_intern_str_unregister, &py_cls_meth)) {
case 1: {
PyObject *ret = PyObject_CallObject(py_cls_meth, NULL);
Py_DECREF(py_cls_meth);
if (ret) {
Py_DECREF(ret);
}