mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-26 15:48:09 +00:00
Check for NULL pointer before calling *_ref() function in Python wrapper.
This commit is contained in:
parent
6a191c2fb5
commit
0aca2d72fc
1 changed files with 5 additions and 1 deletions
|
|
@ -160,7 +160,11 @@ class MethodDefinition:
|
|||
new_from_native_pointer_code = "\tpyresult = pylinphone_{return_type}_new_from_native_ptr(&pylinphone_{return_type}Type, cresult);\n".format(return_type=stripped_return_type)
|
||||
if self.self_arg is not None and return_type_class['class_refcountable']:
|
||||
ref_function = return_type_class['class_c_function_prefix'] + "ref"
|
||||
ref_native_pointer_code = "\t{func}(({cast_type})cresult);\n".format(func=ref_function, cast_type=self.remove_const_from_complete_type(self.return_complete_type))
|
||||
ref_native_pointer_code = \
|
||||
""" if (cresult != NULL) {{
|
||||
{func}(({cast_type})cresult);
|
||||
}}
|
||||
""".format(func=ref_function, cast_type=self.remove_const_from_complete_type(self.return_complete_type))
|
||||
result_variable = 'pyresult'
|
||||
else:
|
||||
result_variable = 'cresult'
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue