зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1663053 - Bail out from HTMLCanvasElement::CallPrintCallback is `mPrintState` has already destroyed. r=jwatt
Differential Revision: https://phabricator.services.mozilla.com/D89264
This commit is contained in:
Родитель
ce92c2ec3c
Коммит
ab59636fca
|
@ -497,6 +497,12 @@ nsresult HTMLCanvasElement::DispatchPrintCallback(nsITimerCallback* aCallback) {
|
|||
|
||||
MOZ_CAN_RUN_SCRIPT
|
||||
void HTMLCanvasElement::CallPrintCallback() {
|
||||
if (!mPrintState) {
|
||||
// `mPrintState` might have been destroyed by cancelling the previous
|
||||
// printing (especially the canvas frame destruction) during processing
|
||||
// event loops in the printing.
|
||||
return;
|
||||
}
|
||||
RefPtr<PrintCallback> callback = GetMozPrintCallback();
|
||||
RefPtr<HTMLCanvasPrintState> state = mPrintState;
|
||||
callback->Call(*state);
|
||||
|
|
Загрузка…
Ссылка в новой задаче