Skip to content

Commit 7fb22f6

Browse files
committed
Fix leak of Reference-inherited objects
1 parent f3da1c6 commit 7fb22f6

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

godot.nimble

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
version = "0.8.2"
1+
version = "0.8.3"
22
author = "Xored Software, Inc."
33
description = "Godot Engine bindings"
44
license = "MIT"
55
srcDir = "godot"
66

7-
requires "nim >= 0.17.3", "compiler >= 0.17.3"
7+
requires "nim >= 0.17.3", "compiler >= 0.17.3"

godot/nim/godotnim.nim

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,8 @@ proc nimGodotObjectFinalizer*[T: NimGodotObject](obj: T) =
196196
obj.isFinalized = true
197197
if (obj.isRef or not obj.linkedObject.isNil and obj.linkedObject.isRef) and
198198
obj.godotObject.unreference():
199+
if not obj.linkedObject.isNil:
200+
GC_unref(obj.linkedObject)
199201
obj.deinit()
200202
201203
macro baseNativeType(T: typedesc): cstring =

0 commit comments

Comments
 (0)