From f13ea6af5be4ca04ec113f8c852d59d90993baa2 Mon Sep 17 00:00:00 2001 From: Bob Owen Date: Fri, 12 Jan 2018 10:17:36 +0000 Subject: Bug 1426087 - Decrement nsDocumentViewer::mDestroyRefCount in a separate function. r=jwatt, a=RyanVM --HG-- extra : source : 86d41b5efe074f6988085082df9ef537eee0813a extra : intermediate-source : ea406489f93a0a8fa05ff568acdff07ce6b118c4 --- layout/printing/nsPagePrintTimer.cpp | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'layout/printing/nsPagePrintTimer.cpp') diff --git a/layout/printing/nsPagePrintTimer.cpp b/layout/printing/nsPagePrintTimer.cpp index b56569a9a..164b0469a 100644 --- a/layout/printing/nsPagePrintTimer.cpp +++ b/layout/printing/nsPagePrintTimer.cpp @@ -14,14 +14,8 @@ NS_IMPL_ISUPPORTS_INHERITED(nsPagePrintTimer, mozilla::Runnable, nsITimerCallbac nsPagePrintTimer::~nsPagePrintTimer() { - // "Destroy" the document viewer; this normally doesn't actually - // destroy it because of the IncrementDestroyRefCount call below - // XXX This is messy; the document viewer should use a single approach - // to keep itself alive during printing - nsCOMPtr cv(do_QueryInterface(mDocViewerPrint)); - if (cv) { - cv->Destroy(); - } + // This matches the IncrementDestroyRefCount call in the constructor. + mDocViewerPrint->DecrementDestroyRefCount(); } nsresult -- cgit v1.2.3