Skip to content

Commit

Permalink
Fix clean up in the case of the window close event being prevented (#182
Browse files Browse the repository at this point in the history
)
  • Loading branch information
lovemegowin authored Aug 23, 2024
1 parent 2193d7a commit a4be72c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -374,12 +374,12 @@ export default function contextMenu(options = {}) {
const disposeMenu = create(win, options);

const disposable = () => {
win.off('close', disposable);
win.webContents.off('destroyed', disposable);
disposeMenu();
};

if (win.once !== undefined) { // Support for BrowserView
win.once('close', disposable);
win.webContents.once('destroyed', disposable);
}
};

Expand Down

0 comments on commit a4be72c

Please sign in to comment.