fix: remove menu observer before destroying menu_controller_ (#49648)

* fix: remove menu observer before destroying menu_controller_

* fix: resolves private inheritance conflict
This commit is contained in:
Keeley Hammond
2026-02-04 07:11:00 -08:00
committed by GitHub
parent 51a9101c3d
commit 431f77ca1c
3 changed files with 13 additions and 1 deletions

View File

@@ -51,7 +51,11 @@ namespace electron::api {
MenuMac::MenuMac(gin::Arguments* args) : Menu{args} {}
MenuMac::~MenuMac() = default;
MenuMac::~MenuMac() {
// Must remove observer before destroying menu_controller_, which holds
// a weak reference to model_
RemoveModelObserver();
}
void MenuMac::PopupAt(BaseWindow* window,
std::optional<WebFrameMain*> frame,