Skip to content

Commit d670953

Browse files
committed
Cleanup the object cache in JSObjectRef.deinit
1 parent de328ff commit d670953

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Sources/JavaScriptKit/JSObject.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,8 @@ public class JSObjectRef: Equatable {
6363
public static let global = JSObjectRef(id: _JS_Predef_Value_Global)
6464

6565
deinit {
66-
_destroy_ref(id)
66+
cache[id] = nil
67+
_destroy_ref(id)
6768
}
6869

6970
public static func == (lhs: JSObjectRef, rhs: JSObjectRef) -> Bool {

0 commit comments

Comments
 (0)