mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-01-30 18:31:08 +00:00
Fix deleting active menuitem from crashing b=250276 p=vlad r=ben sr=shaver a=asa
This commit is contained in:
parent
10817e2357
commit
0cad062d52
@ -335,6 +335,16 @@ nsMenuFrame::DestroyPopupFrames(nsPresContext* aPresContext)
|
||||
NS_IMETHODIMP
|
||||
nsMenuFrame::Destroy(nsPresContext* aPresContext)
|
||||
{
|
||||
// are we our menu parent's current menu item?
|
||||
if (mMenuParent) {
|
||||
nsIMenuFrame *curItem = nsnull;
|
||||
mMenuParent->GetCurrentMenuItem(&curItem);
|
||||
if (curItem == this) {
|
||||
// yes; tell it that we're going away
|
||||
mMenuParent->SetCurrentMenuItem(nsnull);
|
||||
}
|
||||
}
|
||||
|
||||
DestroyPopupFrames(aPresContext);
|
||||
return nsBoxFrame::Destroy(aPresContext);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user