[3.x] Fix JavaScript callback memory leak

(cherry picked from commit 8ac91f813f)
This commit is contained in:
SysError99 2023-08-29 03:12:53 +07:00 committed by Rémi Verschelde
parent dc095b8ad4
commit d20dfcfe79
No known key found for this signature in database
GPG Key ID: C3336907360768E1
1 changed files with 3 additions and 1 deletions

View File

@ -205,7 +205,9 @@ const GodotJSWrapper = {
return;
}
const args = Array.from(arguments);
func(p_ref, GodotJSWrapper.get_proxied(args), args.length);
const argsProxy = new GodotJSWrapper.MyProxy(args);
func(p_ref, argsProxy.get_id(), args.length);
argsProxy.unref();
};
id = GodotJSWrapper.get_proxied(cb);
return id;