Bug 1657911 - Call nsDeviceContext::UnregisterPageDoneCallback only in the parent process and only if IsSyncPagePrinting. r=jwatt

The call sites of nsDeviceContext::RegisterPageDoneCallback are in the parent
process along with the IsSyncPagePrinting check.

Differential Revision: https://phabricator.services.mozilla.com/D86868
This commit is contained in:
Hiroyuki Ikezoe 2020-08-13 23:15:37 +00:00
Родитель f51ddfbfeb
Коммит 4400ed3d5b
1 изменённых файлов: 4 добавлений и 1 удалений

Просмотреть файл

@ -2480,7 +2480,10 @@ bool nsPrintJob::DonePrintingPages(nsPrintObject* aPO, nsresult aResult) {
}
}
printData->mPrintDC->UnregisterPageDoneCallback();
if (XRE_IsParentProcess() && printData->mPrintDC &&
!printData->mPrintDC->IsSyncPagePrinting()) {
printData->mPrintDC->UnregisterPageDoneCallback();
}
if (NS_SUCCEEDED(aResult)) {
FirePrintCompletionEvent();