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
{{ message }}
This repository was archived by the owner on Jul 22, 2023. It is now read-only.
Using events in renderer process throw error on development console
saying Attempting to call a function in a renderer window that has been closed or released.
Using events in renderer process throw error on development console
saying Attempting to call a function in a renderer window that has been closed or released.
This will cause error because you haven't cleaned up correctly and a listener exists on a remote object from a renderer that does not exist any more.
Solution - Avoid using remote or clean up your event handlers on remote objects if you have to use it
Add event remover in your code where you had added events code
This will remove ALL listeners attached to your window before unloading it.
Note - onbeforeunload will be called before page is refreshed or closed.
Screenshot-

Conclusion- update tutorial to adapt to solution
To reproduce-
This is not same as your tutorial but here too I am using win.on events for blur and focus and it throws errors.
https://gist.github.com/AtiqGauri/1cea1c548025faa77f9f29008ca5a5fe#file-main-js-L4