1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-29 15:23:05 +04:00

Fix reference counting errors in registerNewType

This commit is contained in:
Spike
2023-03-13 22:54:47 -06:00
parent 22a52766dc
commit 95f087cd0b
2 changed files with 3 additions and 0 deletions
+2
View File
@@ -338,8 +338,10 @@ PyObject* pyopencv_from(const TYPE& src)
if (!registerNewType(m, #EXPORT_NAME, (PyObject*)pyopencv_##CLASS_ID##_TypePtr, SCOPE)) \
{ \
printf("Failed to register a new type: " #EXPORT_NAME ", base (" #BASE ") in " SCOPE " \n"); \
Py_DECREF(pyopencv_##CLASS_ID##_TypePtr); \
ERROR_HANDLER; \
} \
Py_DECREF(pyopencv_##CLASS_ID##_TypePtr); \
}
// Debug module load: