diff options
author | Moonchild <moonchild@palemoon.org> | 2021-11-05 00:49:39 +0000 |
---|---|---|
committer | Moonchild <moonchild@palemoon.org> | 2022-04-04 22:07:00 +0200 |
commit | a9376e01cb3ebfa3c979fd5ab7bdfb6c1e0ed96d (patch) | |
tree | 08bf8d9eef4cba4a93b4e19b3e1a9d5801dc24ba | |
parent | 8884db9790650ee8043299d421e4eb30ad9fc031 (diff) | |
download | uxp-a9376e01cb3ebfa3c979fd5ab7bdfb6c1e0ed96d.tar.gz |
[layout] Hold strong references to delayed menu command events.
-rw-r--r-- | layout/xul/nsMenuFrame.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/layout/xul/nsMenuFrame.cpp b/layout/xul/nsMenuFrame.cpp index 087323a875..30cab242ea 100644 --- a/layout/xul/nsMenuFrame.cpp +++ b/layout/xul/nsMenuFrame.cpp @@ -1273,7 +1273,9 @@ nsMenuFrame::PassMenuCommandEventToPopupManager() nsXULPopupManager* pm = nsXULPopupManager::GetInstance(); nsMenuParent* menuParent = GetMenuParent(); if (pm && menuParent && mDelayedMenuCommandEvent) { - pm->ExecuteMenu(mContent, mDelayedMenuCommandEvent); + nsCOMPtr<nsIContent> content = mContent; + RefPtr<nsXULMenuCommandEvent> event = mDelayedMenuCommandEvent; + pm->ExecuteMenu(content, event); } mDelayedMenuCommandEvent = nullptr; } |