Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Destroy Menubar #281

Open
jakiestfu opened this issue Apr 27, 2020 · 1 comment · May be fixed by #323
Open

Destroy Menubar #281

jakiestfu opened this issue Apr 27, 2020 · 1 comment · May be fixed by #323

Comments

@jakiestfu
Copy link

Description

There is no API to destroy a menubar instance. I'm implementing a feature in my application which will allow the end-users to run their Electron app in a tray or a window, but there is no mechanism to tear-down a menubar.

Steps to Reproduce the Problem

  1. Create a menubar
  2. Destroy Window Reference
  3. Error: Object has been destroyed: at Menubar.<anonymous> (my-app/node_modules/menubar/lib/Menubar.js:311:72)

Expected Behaviour

I'd like for the menubar instance to have a teardown function

Actual Behaviour

There is no API to support this

Specifications

  • Menubar version: 6.0.8
  • Platform: Mac
  • Electron version: 7.1.9

Other information

@nguterresn
Copy link

This somehow works for me:

mb.app.removeAllListeners();
mb.tray.removeAllListeners();
mb.window.removeAllListeners();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants