mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-30 04:17:31 +09:00
Bug 1426087 - Decrement nsDocumentViewer::mDestroyRefCount in a separate function. r=jwatt, a=RyanVM
--HG-- extra : source : 86d41b5efe074f6988085082df9ef537eee0813a extra : intermediate-source : ea406489f93a0a8fa05ff568acdff07ce6b118c4
This commit is contained in:
parent
13e195c594
commit
81337d2cfd
3 changed files with 10 additions and 9 deletions
|
|
@ -1617,7 +1617,6 @@ nsDocumentViewer::Destroy()
|
||||||
// We also keep the viewer from being cached in session history, since
|
// We also keep the viewer from being cached in session history, since
|
||||||
// we require all documents there to be sanitized.
|
// we require all documents there to be sanitized.
|
||||||
if (mDestroyRefCount != 0) {
|
if (mDestroyRefCount != 0) {
|
||||||
--mDestroyRefCount;
|
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -4426,6 +4425,12 @@ nsDocumentViewer::IncrementDestroyRefCount()
|
||||||
++mDestroyRefCount;
|
++mDestroyRefCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
nsDocumentViewer::DecrementDestroyRefCount()
|
||||||
|
{
|
||||||
|
--mDestroyRefCount;
|
||||||
|
}
|
||||||
|
|
||||||
//------------------------------------------------------------
|
//------------------------------------------------------------
|
||||||
|
|
||||||
#if defined(NS_PRINTING) && defined(NS_PRINT_PREVIEW)
|
#if defined(NS_PRINTING) && defined(NS_PRINT_PREVIEW)
|
||||||
|
|
|
||||||
|
|
@ -41,6 +41,7 @@ public:
|
||||||
virtual mozilla::StyleSetHandle CreateStyleSet(nsIDocument* aDocument) = 0;
|
virtual mozilla::StyleSetHandle CreateStyleSet(nsIDocument* aDocument) = 0;
|
||||||
|
|
||||||
virtual void IncrementDestroyRefCount() = 0;
|
virtual void IncrementDestroyRefCount() = 0;
|
||||||
|
virtual void DecrementDestroyRefCount() = 0;
|
||||||
|
|
||||||
virtual void ReturnToGalleyPresentation() = 0;
|
virtual void ReturnToGalleyPresentation() = 0;
|
||||||
|
|
||||||
|
|
@ -75,6 +76,7 @@ NS_DEFINE_STATIC_IID_ACCESSOR(nsIDocumentViewerPrint,
|
||||||
bool GetIsPrintPreview() override; \
|
bool GetIsPrintPreview() override; \
|
||||||
mozilla::StyleSetHandle CreateStyleSet(nsIDocument* aDocument) override; \
|
mozilla::StyleSetHandle CreateStyleSet(nsIDocument* aDocument) override; \
|
||||||
void IncrementDestroyRefCount() override; \
|
void IncrementDestroyRefCount() override; \
|
||||||
|
void DecrementDestroyRefCount() override; \
|
||||||
void ReturnToGalleyPresentation() override; \
|
void ReturnToGalleyPresentation() override; \
|
||||||
void OnDonePrinting() override; \
|
void OnDonePrinting() override; \
|
||||||
bool IsInitializedForPrintPreview() override; \
|
bool IsInitializedForPrintPreview() override; \
|
||||||
|
|
|
||||||
|
|
@ -14,14 +14,8 @@ NS_IMPL_ISUPPORTS_INHERITED(nsPagePrintTimer, mozilla::Runnable, nsITimerCallbac
|
||||||
|
|
||||||
nsPagePrintTimer::~nsPagePrintTimer()
|
nsPagePrintTimer::~nsPagePrintTimer()
|
||||||
{
|
{
|
||||||
// "Destroy" the document viewer; this normally doesn't actually
|
// This matches the IncrementDestroyRefCount call in the constructor.
|
||||||
// destroy it because of the IncrementDestroyRefCount call below
|
mDocViewerPrint->DecrementDestroyRefCount();
|
||||||
// XXX This is messy; the document viewer should use a single approach
|
|
||||||
// to keep itself alive during printing
|
|
||||||
nsCOMPtr<nsIContentViewer> cv(do_QueryInterface(mDocViewerPrint));
|
|
||||||
if (cv) {
|
|
||||||
cv->Destroy();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
nsresult
|
nsresult
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue