Bug 830236 (follow-up) - Keep the print engine when printing finished inside Print Preview. Make nsPrintEngine::DestroyPrintingData re-entrancy safe. r=cam

This commit is contained in:
Mats Palmgren 2013-01-20 13:40:09 +01:00
parent fc6d45f790
commit 7a42e0132e
2 changed files with 3 additions and 2 deletions

View File

@ -4263,10 +4263,10 @@ nsDocumentViewer::OnDonePrinting()
#if defined(NS_PRINTING) && defined(NS_PRINT_PREVIEW)
if (mPrintEngine) {
nsRefPtr<nsPrintEngine> pe = mPrintEngine;
mPrintEngine = nullptr;
if (GetIsPrintPreview()) {
pe->DestroyPrintingData();
} else {
mPrintEngine = nullptr;
pe->Destroy();
}

View File

@ -279,8 +279,9 @@ void nsPrintEngine::Destroy()
void nsPrintEngine::DestroyPrintingData()
{
if (mPrt) {
delete mPrt;
nsPrintData* data = mPrt;
mPrt = nullptr;
delete data;
}
}