summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMoonchild <moonchild@palemoon.org>2021-11-05 00:49:39 +0000
committerMoonchild <moonchild@palemoon.org>2022-04-03 01:00:53 +0200
commita9dde3116c2985159e0217a96674fa2d7de4c157 (patch)
treef9f6274470055f81e5d06a7c3c1e17b6690c27d9
parent51c79887115cdd929cd486efc3d8c767e91ce25c (diff)
downloaduxp-a9dde3116c2985159e0217a96674fa2d7de4c157.tar.gz
[layout] Hold strong references to delayed menu command events.RELBASE_20211109-UXP
-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;
}