Merge pull request #81090 from SysError99/3.x-fix-js-callback-mem-leak

[3.x] Fix JavaScript callback memory leak
This commit is contained in:
Rémi Verschelde 2023-09-06 13:03:31 +02:00
commit 10120783d6
No known key found for this signature in database
GPG key ID: C3336907360768E1

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;