From 692e5b4a01c091e83013eff8f4e8940c8311f03a Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Wed, 29 Mar 2023 23:33:00 +0200 Subject: [PATCH] Fixed a reference counting bug (Python) --- src/pya/pya/pyaModule.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pya/pya/pyaModule.cc b/src/pya/pya/pyaModule.cc index 7a02679e6..9effd0051 100644 --- a/src/pya/pya/pyaModule.cc +++ b/src/pya/pya/pyaModule.cc @@ -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); } }