summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMoonchild <moonchild@palemoon.org>2021-11-05 00:49:39 +0000
committerMoonchild <moonchild@palemoon.org>2021-11-05 11:37:34 +0000
commit652171acd5ad50037b1177ec92df82d1f2a5482a (patch)
treefc78e440b484e489cd2a1892f8a24a861ba7b302
parentdb335d499856f741dfd250c533fc0f811fc52ffe (diff)
downloaduxp-RC_20211105.tar.gz
[layout] Hold strong references to delayed menu command events.RELBASE_20211109RC_20211105
-rw-r--r--layout/xul/nsMenuFrame.cpp4
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;
}