Commit 53c66730 authored by Ghislain MARY's avatar Ghislain MARY

Fix reference count problem when returning an already existing Python object...

Fix reference count problem when returning an already existing Python object from the native object user data.
parent b4978948
......@@ -329,7 +329,7 @@ class MethodDefinition:
get_user_data_function = return_type_class['class_c_function_prefix'] + "get_user_data"
return_from_user_data_code = \
"""if ((cresult != NULL) && ({func}(cresult) != NULL)) {{
return (PyObject *){func}(cresult);
return Py_BuildValue("O", (PyObject *){func}(cresult));
}}
""".format(func=get_user_data_function)
new_from_native_pointer_code = "pyresult = pylinphone_{return_type}_new_from_native_ptr(&pylinphone_{return_type}Type, cresult);\n".format(return_type=stripped_return_type)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment