If you store
JSObjectRef on a static global or on the heap, the GC may inadvertently free these objects potentially causing memory corruption / crashes. To prevent this you should use
JSValueUnprotect() to keep them alive.
Updated about 3 years ago