Bug 803255. Ensure previous document viewer is cleared when creating a new one to avoid leaking the old one. r=bz

This commit is contained in:
Felipe Gomes 2012-11-12 13:00:19 -08:00
parent 08e5b80f4e
commit d158dec950

View File

@ -909,6 +909,12 @@ DocumentViewerImpl::InitInternal(nsIWidget* aParentWidget,
mPresContext->SetPageScale(1.0f);
}
#endif
} else {
// Avoid leaking the old viewer.
if (mPreviousViewer) {
mPreviousViewer->Destroy();
mPreviousViewer = nullptr;
}
}
}