Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
niklas2902 committed Nov 4, 2024
2 parents dd1b2f3 + e84d6b9 commit 52cb0e0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
Empty file.
13 changes: 8 additions & 5 deletions py4godot/core/variant4/type_helpers.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,15 @@ cdef api object type_helper_create_string(shared_ptr[bridge.String]& bridge_stri
##Py_INCREF(val)
return val


cdef Object val = None
cdef api object type_helper_create_object(shared_ptr[bridge.Object]& bridge_object):
cdef Object temp_val = Object.__new__(Object)
temp_val.Object_internal_class_ptr = bridge_object
#Py_INCREF(temp_val)
return temp_val
global val
if not val:
val = Object() # Just using object.__new__(Object) crashes. This seems to fix that
val.destroy() # Free object to not run into memory leaks
val.Object_internal_class_ptr = bridge_object
##Py_INCREF(val)
return val


cdef api object type_helper_create_py_string(shared_ptr[bridge.String]& bridge_string):
Expand Down

0 comments on commit 52cb0e0

Please sign in to comment.