Bug 1430687 - Move the mDestroyBlockedCount early return in nsDocumentViewer::Destroy to the top. r=bobowen

MozReview-Commit-ID: Exe0hIFHK8z
This commit is contained in:
Jonathan Watt 2018-01-09 12:47:20 +00:00
Родитель d75df097a4
Коммит 706256a2cc
1 изменённых файлов: 8 добавлений и 8 удалений

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

@ -1655,6 +1655,14 @@ nsDocumentViewer::Destroy()
{
NS_ASSERTION(mDocument, "No document in Destroy()!");
// Don't let the document get unloaded while we are printing.
// this could happen if we hit the back button during printing.
// We also keep the viewer from being cached in session history, since
// we require all documents there to be sanitized.
if (mDestroyBlockedCount != 0) {
return NS_OK;
}
#ifdef NS_PRINTING
// Here is where we check to see if the document was still being prepared
// for printing when it was asked to be destroy from someone externally
@ -1672,14 +1680,6 @@ nsDocumentViewer::Destroy()
mAutoBeforeAndAfterPrint = nullptr;
#endif
// Don't let the document get unloaded while we are printing.
// this could happen if we hit the back button during printing.
// We also keep the viewer from being cached in session history, since
// we require all documents there to be sanitized.
if (mDestroyBlockedCount != 0) {
return NS_OK;
}
// If we were told to put ourselves into session history instead of destroy
// the presentation, do that now.
if (mSHEntry) {