Skip to content

Commit 9df6998

Browse files
committed
Release JSString
1 parent f83a91e commit 9df6998

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

Sources/JavaScript/JSValue.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ public class JSValue {
4242
self.context = context
4343
let bytes = [UInt16](string.utf16)
4444
let stringRef = JSStringCreateWithCharacters(bytes, bytes.count)
45+
defer { JSStringRelease(stringRef) }
4546
self.pointer = JSValueMakeString(context, stringRef)
4647
}
4748
}

0 commit comments

Comments
 (0)