Fix deleting active menuitem from crashing b=250276 p=vlad r=ben sr=shaver a=asa
git-svn-id: svn://10.0.0.236/trunk@167409 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user