зеркало из https://github.com/mozilla/pjs.git
Make sure Destroy() is called before an nsIWidget is destroyed. b=434089 r=bzbarsky sr=vladimir
This commit is contained in:
Родитель
b288d37d9b
Коммит
849e2fec66
|
@ -132,8 +132,11 @@ PRBool PR_CALLBACK deleteListener(void *aElement, void *aData) {
|
|||
NS_IMETHODIMP nsWebBrowser::InternalDestroy()
|
||||
{
|
||||
|
||||
if (mInternalWidget)
|
||||
mInternalWidget->SetClientData(0);
|
||||
if (mInternalWidget) {
|
||||
mInternalWidget->SetClientData(0);
|
||||
mInternalWidget->Destroy();
|
||||
mInternalWidget = nsnull; // Force release here.
|
||||
}
|
||||
|
||||
SetDocShell(nsnull);
|
||||
|
||||
|
|
|
@ -631,6 +631,7 @@ nsresult nsIView::CreateWidget(const nsIID &aWindowIID,
|
|||
ViewWrapper* wrapper = GetWrapperFor(mWindow);
|
||||
NS_IF_RELEASE(wrapper);
|
||||
mWindow->SetClientData(nsnull);
|
||||
mWindow->Destroy();
|
||||
NS_RELEASE(mWindow);
|
||||
}
|
||||
|
||||
|
|
|
@ -146,9 +146,11 @@ nsWebShellWindow::~nsWebShellWindow()
|
|||
if (gFocusedWindowBeforeSuppression == this) {
|
||||
gFocusedWindowBeforeSuppression = nsnull;
|
||||
}
|
||||
if (mWindow)
|
||||
if (mWindow) {
|
||||
mWindow->SetClientData(0);
|
||||
mWindow = nsnull; // Force release here.
|
||||
mWindow->Destroy();
|
||||
mWindow = nsnull; // Force release here.
|
||||
}
|
||||
|
||||
if (mSPTimerLock) {
|
||||
PR_Lock(mSPTimerLock);
|
||||
|
|
Загрузка…
Ссылка в новой задаче