Bug 1404176 - Remove aborted print preview browser before bailing out. r?mconley draft
authorMatheus Longaray <mlongaray@hp.com>
Mon, 13 Nov 2017 17:17:57 +0100
changeset 697232 e51091ea137b84ebe4c5dcc0f3e69db8c4703d70
parent 697096 fc194660762d1b92e1679d860a8bf41116d0f54f
child 740049 aa3d7f5853810645c79cf8cc5a496789b70064a3
push id88925
push userbmo:mlongaray@hp.com
push dateMon, 13 Nov 2017 16:21:46 +0000
reviewersmconley
bugs1404176
milestone59.0a1
Bug 1404176 - Remove aborted print preview browser before bailing out. r?mconley This patch clears out set of print preview browsers before bailing out when there is an error while putting the document into print preview mode. MozReview-Commit-ID: 20cm4DCktQk
toolkit/components/printing/content/printUtils.js
--- a/toolkit/components/printing/content/printUtils.js
+++ b/toolkit/components/printing/content/printUtils.js
@@ -597,16 +597,17 @@ var PrintUtils = {
     }
 
     let onEntered = (message) => {
       mm.removeMessageListener("Printing:Preview:Entered", onEntered);
 
       if (message.data.failed) {
         // Something went wrong while putting the document into print preview
         // mode. Bail out.
+        this._ppBrowsers.clear();
         this._listener.onEnter();
         this._listener.onExit();
         return;
       }
 
       // Stash the focused element so that we can return to it after exiting
       // print preview.
       gFocusedElement = document.commandDispatcher.focusedElement;