flutter_js
flutter_js copied to clipboard
reference leak
flutter: reference leak:
ADDR REF TYPE PROP
12721561 1 _JSFunction (key, val) => { this[key] = val; } ...
403143782 1 _JSFunction function XMLHttpRequest() { ...
260057805 1 _JSFunction function FLUTTER_NATIVEJS_MakeQuerablePromise(promise) { ...
#0 new JSError
object.dart:92
#1 QuickJsRuntime2.close
quickjs_runtime2.dart:137
#2 QuickJsRuntime2.dispose
quickjs_runtime2.dart:211
flutter_js: ^0.7.0
still ocurring in 0.8.0
@abner so far during usage i have not found any issues because of this, based on your experience can you tell if this is concerning or we can treat it as a let's say a warning ?
I'm also facing a memory leak problem, but i have no idea why's it 😂
version: 0.8.1 has not free JsRef.
- for
(key, val) => { this[key] = val; },in quickjs/quickjs_runtime2.dart,QuickJsRuntime2#initChannelFunctions has not call JsRef.freeRecursive(setToGlobalObject) - for
function XMLHttpRequest(), in extensions/xhr.dart,JavascriptRuntimeXhrExtension#enableXhr,has not call JsRef.freeRecursive(evalXhrResult.rawResult)
final evalXhrResult = this.evaluate(xhrJsCode);
if (_XHR_DEBUG) print('RESULT evalXhrResult: $evalXhrResult');
- for
function FLUTTER_NATIVEJS_MakeQuerablePromise(promise),JavascriptRuntime.localContext save JS value,need to JsRef.freeRecursive it' values too.
In addition, I find in other place also has not free ref.
- extensions/handler_promises.dart,HandlePromises#_doHandlePromise,
final fnRegisterPromiseFunction = evaluate(REGISTER_PROMISE_FUNCTION);,has not call JsRef.freeRecursive(fnRegisterPromiseFunction.rawResult)
- but this place maybe only for JavaScriptCore ,no about QuickJs(for Promise always covert to Future)
maybe every place use evaluate to get function has not free JsRef.
hope someone to update it!!!!!
it's a good library, hope it does not get abandoned.