Don't leak memory from Ref<>()

This commit is contained in:
karroffel
2018-01-19 11:40:50 +01:00
parent 131cf2581e
commit 2e4de7b67d
2 changed files with 37 additions and 58 deletions

View File

@@ -341,7 +341,7 @@ def generate_class_implementation(icalls, used_classes, c):
if is_enum(method["return_type"]):
return_statement += "return (" + remove_enum_prefix(method["return_type"]) + ") "
elif is_reference_type(method["return_type"]):
return_statement += "return Ref<" + strip_name(method["return_type"]) + ">::__internal_constructor(";
return_statement += "return Ref<" + strip_name(method["return_type"]) + ">(";
else:
return_statement += "return " + ("(" + strip_name(method["return_type"]) + " *) " if is_class_type(method["return_type"]) else "")
else: