You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I dispose the QuickJS engine I get a reference leak after doing a Object.freeze.
reference leak:
ADDR REF TYPE PROP
986107159 1 _JSFunction function () { ...
#0 new JSError
package:flutter_qjs/src/object.dart:93
#1 FlutterQjs.close
package:flutter_qjs/src/engine.dart:136
#2 main.<anonymous closure>
If I don't do the Object.freeze it all works fine.
To reproduce run this test code:
test('ref leak', () async {
final qjs =FlutterQjs(timeout:1000);
int counter =0;
voidclick() => counter++;
final myObj = {'click': click};
finalJSInvokable setToGlobal =await qjs.evaluate(
'(name, obj) => { this[name] = obj; }',
);
setToGlobal.invoke(['myObj', myObj]);
setToGlobal.free();
// comment the following line and it will work.await qjs.evaluate('Object.freeze(myObj);');
await qjs.evaluate('myObj.click();');
expect(counter, 1);
expect(
() => qjs.close(),
returnsNormally,
reason:'There should be no reference leak when freezing an object in QuickJS',
);
});
The text was updated successfully, but these errors were encountered:
When I dispose the QuickJS engine I get a reference leak after doing a Object.freeze.
If I don't do the
Object.freeze
it all works fine.To reproduce run this test code:
The text was updated successfully, but these errors were encountered: