diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2023-09-07 16:32:06 +0200 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2023-09-07 16:32:06 +0200 |
commit | 2cd740fd7a8486c96f466b5697bdb86c55af3f33 (patch) | |
tree | 2357bf9a065781ea850e7a330e94a0be86dae1ee /platform/web | |
parent | 0f38fdf9c3f6354f853bfaa06f5f22d8a888d681 (diff) | |
parent | 6a90164a0319276133a809bd32c366dd5d4c33d4 (diff) | |
download | redot-engine-2cd740fd7a8486c96f466b5697bdb86c55af3f33.tar.gz |
Merge pull request #81105 from SysError99/master-fix-js-mem-leak
Fix JavaScript callback memory leak issue
Diffstat (limited to 'platform/web')
-rw-r--r-- | platform/web/js/libs/library_godot_javascript_singleton.js | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/platform/web/js/libs/library_godot_javascript_singleton.js b/platform/web/js/libs/library_godot_javascript_singleton.js index 1f3633461b..cbe59230ee 100644 --- a/platform/web/js/libs/library_godot_javascript_singleton.js +++ b/platform/web/js/libs/library_godot_javascript_singleton.js @@ -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; |