зеркало из https://github.com/mozilla/gecko-dev.git
Added code to Ondestroy() to do an AddRef() before calling DispatchStandardEvent()
and then a Release() afterwards. This ensures the object doesn't get destroyed until after we've dispatched the event
This commit is contained in:
Родитель
032ca1e974
Коммит
c876b84e2e
|
@ -1737,7 +1737,15 @@ void nsWindow::OnDestroy()
|
||||||
NS_RELEASE(mToolkit);
|
NS_RELEASE(mToolkit);
|
||||||
mToolkit = NULL;
|
mToolkit = NULL;
|
||||||
}
|
}
|
||||||
DispatchStandardEvent(NS_DESTROY);
|
|
||||||
|
if (!mIsDestroying) {
|
||||||
|
// Dispatching of the event may cause the reference count to drop to 0
|
||||||
|
// and result in this object being destroyed. To avoid that, add a reference
|
||||||
|
// and then release it after dispatching the event
|
||||||
|
AddRef();
|
||||||
|
DispatchStandardEvent(NS_DESTROY);
|
||||||
|
Release();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//-------------------------------------------------------------------------
|
//-------------------------------------------------------------------------
|
||||||
|
|
Загрузка…
Ссылка в новой задаче