about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2023-06-20 10:16:09 +0200
committerbptato <nincsnevem662@gmail.com>2023-06-20 10:16:09 +0200
commit6a2d7aa639af60db59ca035a11e60e31c90f5284 (patch)
treea662c20957ff7c620223f939757f76f645c368c1
parentbfd51fa9da7f0bf196651e64f8c22ffaeae0b606 (diff)
downloadchawan-6a2d7aa639af60db59ca035a11e60e31c90f5284.tar.gz
Do not GC_ref JS object opaques
So that the finalizer is actually triggered
-rw-r--r--src/js/javascript.nim1
1 files changed, 0 insertions, 1 deletions
diff --git a/src/js/javascript.nim b/src/js/javascript.nim
index 737f2a20..38ba46bc 100644
--- a/src/js/javascript.nim
+++ b/src/js/javascript.nim
@@ -237,7 +237,6 @@ proc setOpaque*[T](ctx: JSContext, val: JSValue, opaque: T) =
   GC_ref(alt)
   rtOpaque.altplist[p] = cast[pointer](alt)
   JS_SetOpaque(val, cast[pointer](opaque))
-  GC_ref(opaque)
 
 func isGlobal*(ctx: JSContext, class: string): bool =
   assert class != ""