electron / electron/remote

Invoke async method on remote object got by remote.getGlobal causes memory leak.

Open
#135 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
411
Forks
53
Avg merge
3m
Merged PRs (30d)
1

Description

The following is the test case.

In the test case, after the ```callback``` has been called, the ```arrow function``` keep been strongly referenced by ```the remote module```,and cannot be gc collected.

```
// main process

global.foo = {bar: {
testCallback(cb){
cb && cb('testCallback');
}
}};
```

```
// renderer process

let bar = remote.getGlobal('foo').bar;

// create a big array, to make monitor the memory leak easily
let willLeakArray = [];
for (let i = 0; i < 1024 * 1024 * 10; i++) {
willLeakArray.push('' + i);
}
bar.testCallback((value)=> {
console.log('testCallback', value, willLeakArray.length );
})
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.