Преглед изворни кода

Fix JavaScript callback memory leak issue

Typo fix

(cherry picked from commit 6a90164a0319276133a809bd32c366dd5d4c33d4)
SysError99 пре 2 година
родитељ
комит
55ae5b0a78
1 измењених фајлова са 3 додато и 1 уклоњено
  1. 3 1
      platform/web/js/libs/library_godot_javascript_singleton.js

+ 3 - 1
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;