Fix possible double free memory on exit
This commit is contained in:
parent
db4bb91765
commit
f45281f5a0
2 changed files with 3 additions and 3 deletions
|
|
@ -1,4 +1,4 @@
|
|||
version = "0.7.19"
|
||||
version = "0.7.20"
|
||||
author = "Xored Software, Inc."
|
||||
description = "Godot Engine bindings"
|
||||
license = "MIT"
|
||||
|
|
|
|||
|
|
@ -189,8 +189,8 @@ proc nimGodotObjectFinalizer*[T: NimGodotObject](obj: T) =
|
|||
if obj.godotObject.isNil or obj.isNative: return
|
||||
# important to set it before so that ``unreference`` is aware
|
||||
obj.isFinalized = true
|
||||
if obj.isRef and obj.godotObject.unreference() or
|
||||
not obj.linkedObject.isNil:
|
||||
if (obj.isRef or not obj.linkedObject.isNil and obj.linkedObject.isRef) and
|
||||
obj.godotObject.unreference():
|
||||
obj.deinit()
|
||||
|
||||
macro baseNativeType(T: typedesc): cstring =
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue