Fix JavaScript callback memory leak issue

Typo fix

(cherry picked from commit 6a90164a03)
This commit is contained in:
SysError99 2023-08-29 13:57:44 +07:00 committed by Yuri Sizov
parent 314dac441b
commit 55ae5b0a78
1 changed files with 3 additions and 1 deletions

View File

@ -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;