10 or more webviews trigger an "EventEmitter memory leak detected" error


#1

I’m not really sure why this is the case but adding 10 or more to your index.html file will trigger an “EventEmitter memory leak detected” error - even if the webview src is empty.

Full error:
internal/process/warning.js:24 Warning: Possible EventEmitter memory leak detected. 11 ELECTRON_RENDERER_WINDOW_VISIBILITY_CHANGE listeners added. Use emitter.setMaxListeners() to increase limit

Code to reproduce: Gist

I understand that you can theoretically increase limit but;
a) I have not found a way that works yet.
b) I would like to know why webviews (including the empty ones) are adding listeners to trigger the error.

Any insight into this would be great.

Thanks!


#2

ipcRenderer.setMaxListeners(0);