Skip to content

Commit

Permalink
[3.x] Fix JavaScript callback memory leak
Browse files Browse the repository at this point in the history
  • Loading branch information
SysError99 committed Aug 28, 2023
1 parent 47e6467 commit 8ac91f8
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 8ac91f8

Please sign in to comment.