commit 315fe73694f9 Author: Matt Woodrow Date: Tue Nov 14 10:31:36 2017 +1300 Bug 1261175. r=bobowen a=gchang MozReview-Commit-ID: B9yAN0F01rj --HG-- extra : amend_source : 7585df8257930896070ddcb64c93a28a39fbbee7 --- layout/base/nsDocumentViewer.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git layout/base/nsDocumentViewer.cpp layout/base/nsDocumentViewer.cpp index be33cf990d91..4fe03d3f7f88 100644 --- layout/base/nsDocumentViewer.cpp +++ layout/base/nsDocumentViewer.cpp @@ -549,6 +549,12 @@ nsDocumentViewer::~nsDocumentViewer() mDocument->Destroy(); } + if (mPrintEngine) { + mPrintEngine->Destroy(); + mPrintEngine = nullptr; + } + + MOZ_RELEASE_ASSERT(mDestroyRefCount == 0); NS_ASSERTION(!mPresShell && !mPresContext, "User did not call nsIContentViewer::Destroy"); if (mPresShell || mPresContext) {