Fix a crash when tearing down a document viewer if a document never started to load (bug 295085). r+sr=bzbarsky, a=chofmann.

This commit is contained in:
bryner%brianryner.com 2005-06-02 01:02:16 +00:00
parent 72c6c61b72
commit 606589d9d8

View File

@ -1375,8 +1375,10 @@ DocumentViewerImpl::Destroy()
return NS_OK;
}
mDocument->Destroy();
mDocument = nsnull;
if (mDocument) {
mDocument->Destroy();
mDocument = nsnull;
}
// All callers are supposed to call destroy to break circular
// references. If we do this stuff in the destructor, the