Fix deleting active menuitem from crashing b=250276 p=vlad r=ben sr=shaver a=asa

This commit is contained in:
neil%parkwaycc.co.uk 2005-01-07 23:59:12 +00:00
parent 10817e2357
commit 0cad062d52

View File

@ -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);
}