Skip to content

Commit

Permalink
Bug 1430687 - Move the mDestroyBlockedCount early return in nsDocumen…
Browse files Browse the repository at this point in the history
…tViewer::Destroy to the top. r=bobowen

MozReview-Commit-ID: Exe0hIFHK8z
  • Loading branch information
jwatt committed Jan 9, 2018
1 parent d75df09 commit 706256a
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions layout/base/nsDocumentViewer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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) {
Expand Down

0 comments on commit 706256a

Please sign in to comment.