Fixed a reference counting bug (Python)

This commit is contained in:
Matthias Koefferlein 2023-03-29 23:33:00 +02:00
parent cb0f2b4166
commit 692e5b4a01
1 changed files with 2 additions and 2 deletions

View File

@ -266,8 +266,8 @@ public:
// add to the parent class as child class or add to module
if (! cls->parent ()) {
PyList_Append (m_all_list, PythonRef (c2python (cls->name ())).get ());
PyModule_AddObject (mp_module->module (), cls->name ().c_str (), (PyObject *) pt);
PyList_Append (m_all_list, c2python (cls->name ()));
PyModule_AddObjectRef (mp_module->module (), cls->name ().c_str (), (PyObject *) pt);
}
}