Skip to content

Commit

Permalink
Fix memory error with circle reference in JavaScript
Browse files Browse the repository at this point in the history
  • Loading branch information
Geequlim committed Dec 13, 2019
1 parent 6d5daed commit 8d0262e
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions quickjs/quickjs_binder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -952,6 +952,7 @@ void QuickJSBinder::free_object_binding_data(void *p_gc_handle) {
ECMAScriptGCHandler *bind = (ECMAScriptGCHandler *)p_gc_handle;
if (bind->is_object()) {
JSValue js_obj = JS_MKPTR(JS_TAG_OBJECT, bind->ecma_object);
JS_SetOpaque(js_obj, NULL);
JS_FreeValue(ctx, js_obj);
}
memdelete(bind);
Expand Down

0 comments on commit 8d0262e

Please sign in to comment.