mirror of
https://github.com/opencv/opencv.git
synced 2026-07-25 21:33:04 +04:00
Fix reference counting errors in registerNewType
This commit is contained in:
@@ -284,6 +284,7 @@ static bool init_submodule(PyObject * root, const char * name, PyMethodDef * met
|
||||
static inline
|
||||
bool registerTypeInModuleScope(PyObject* module, const char* type_name, PyObject* type_obj)
|
||||
{
|
||||
Py_INCREF(type_obj); /// Give PyModule_AddObject a reference to steal.
|
||||
if (PyModule_AddObject(module, type_name, type_obj) < 0)
|
||||
{
|
||||
PyErr_Format(PyExc_ImportError,
|
||||
|
||||
Reference in New Issue
Block a user