Fix T71680: _PyObject_LookupAttr memory leak
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user