1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-04 12:00:25 +00:00

[3.x] Fix JavaScript callback memory leak

This commit is contained in:
SysError99
2023-08-29 03:12:53 +07:00
parent 47e64671f6
commit 8ac91f813f

View File

@@ -205,7 +205,9 @@ const GodotJSWrapper = {
return; return;
} }
const args = Array.from(arguments); 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); id = GodotJSWrapper.get_proxied(cb);
return id; return id;