Bug 1238707 Release the window immediately in TabParent::Destroy() to avoid leaks. r=smaug

This commit is contained in:
Ben Kelly 2016-04-04 14:08:17 -07:00
Родитель d7dfb00a02
Коммит 21fd4f4b0b
2 изменённых файлов: 5 добавлений и 1 удалений

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

@ -5430,7 +5430,7 @@ ContentParent::RecvCreateWindow(PBrowserParent* aThisTab,
// Opening new tabs is the easy case...
if (openLocation == nsIBrowserDOMWindow::OPEN_NEWTAB) {
if (NS_WARN_IF(!browserDOMWin)) {
*aResult = NS_ERROR_FAILURE;
*aResult = NS_ERROR_ABORT;
return true;
}

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

@ -606,6 +606,10 @@ TabParent::DestroyInternal()
void
TabParent::Destroy()
{
// Aggressively release the window to avoid leaking the world in shutdown
// corner cases.
mBrowserDOMWindow = nullptr;
if (mIsDestroyed) {
return;
}