Treverix / custom-electron-titlebar

Custom electon title bar inpire on VS Code title bar
MIT License
35 stars 6 forks source link

Attempting to call a function in a renderer window that has been closed or released #24

Open DanielMcAssey opened 2 years ago

DanielMcAssey commented 2 years ago

Describe the bug Getting an error which doesn't seem to affect anything, however does cause a stutter.

Attempting to call a function in a renderer window that has been closed or released. Function provided here: Titlebar.registerListeners (C:**\node_modules\@treverix\custom-electron-titlebar\dist\titlebar.js:110:26

The error originates from here: https://github.com/Treverix/custom-electron-titlebar/blob/5c59a6db4d75ba1c6398cfc7d9d9fb8c87ba9144/src/titlebar.ts#L131

To Reproduce Steps to reproduce the behavior:

  1. Launch Electron
  2. Happens immediately and appears in the console

Expected behavior Error shouldnt happen, its likely the handle for the current window is not removing listeners, maybe missing an event to removeListeners.

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):