Skip to content

Commit

Permalink
Fix JavaScript callback memory leak issue
Browse files Browse the repository at this point in the history
Typo fix
  • Loading branch information
SysError99 committed Sep 7, 2023
1 parent 541674d commit 6a90164
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion platform/web/js/libs/library_godot_javascript_singleton.js
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,9 @@ const GodotJSWrapper = {
// This is safe! JavaScript is single threaded (and using it in threads is not a good idea anyway).
GodotJSWrapper.cb_ret = null;
const args = Array.from(arguments);
func(p_ref, GodotJSWrapper.get_proxied(args), args.length);
const argsProxy = GodotJSWrapper.MyProxy(args);
func(p_ref, argsProxy.get_id(), args.length);
argsProxy.unref();
const ret = GodotJSWrapper.cb_ret;
GodotJSWrapper.cb_ret = null;
return ret;
Expand Down

0 comments on commit 6a90164

Please sign in to comment.