Bug 888236 - Cleanup MetroWidget's Destroy method, shutdown layer manager and call base widget destroy methods. Potential fix for crash in nsIFrame::GetNearestWidget(). r=bbondy

This commit is contained in:
Jim Mathies 2013-07-17 13:43:26 -05:00
parent 3718002644
commit 92e43f1a4b

View File

@ -244,9 +244,29 @@ MetroWidget::Destroy()
return NS_OK;
Log("[%X] %s mWnd=%X type=%d", this, __FUNCTION__, mWnd, mWindowType);
mOnDestroyCalled = true;
nsCOMPtr<nsIWidget> kungFuDeathGrip(this);
RemoveSubclass();
NotifyWindowDestroyed();
// Prevent the widget from sending additional events.
mWidgetListener = nullptr;
mAttachedWidgetListener = nullptr;
// Release references to children, device context, toolkit, and app shell.
nsBaseWidget::Destroy();
nsBaseWidget::OnDestroy();
if (mLayerManager) {
mLayerManager->Destroy();
}
mLayerManager = nullptr;
mView = nullptr;
mIdleService = nullptr;
mWnd = NULL;
return NS_OK;
}