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
Родитель a54e433303
Коммит eacf2c8722
1 изменённых файлов: 10 добавлений и 0 удалений

Просмотреть файл

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