commit 5e7c00234438470bc4d8052bb3848e75652e63cb
parent 961902d309f66afd3cc736f78db0739d618d1e93
Author: Alexandre Poirot <poirot.alex@gmail.com>
Date: Tue, 7 Oct 2025 22:22:12 +0000
Bug 1991698 - [devtools] Drop inspector actions as soon as the panel starts destroying. r=devtools-reviewers,nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D267192
Diffstat:
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/devtools/client/inspector/changes/ChangesView.js b/devtools/client/inspector/changes/ChangesView.js
@@ -268,8 +268,6 @@ class ChangesView {
{ onAvailable: this.onResourceAvailable }
);
- this.store.dispatch(resetChanges());
-
this.document = null;
this.inspector = null;
this.store = null;
diff --git a/devtools/client/inspector/inspector.js b/devtools/client/inspector/inspector.js
@@ -11,6 +11,9 @@ const { Toolbox } = require("resource://devtools/client/framework/toolbox.js");
const createStore = require("resource://devtools/client/inspector/store.js");
const InspectorStyleChangeTracker = require("resource://devtools/client/inspector/shared/style-change-tracker.js");
const { PrefObserver } = require("resource://devtools/client/shared/prefs.js");
+const {
+ START_IGNORE_ACTION,
+} = require("resource://devtools/client/shared/redux/middleware/ignore.js");
// Use privileged promise in panel documents to prevent having them to freeze
// during toolbox destruction. See bug 1402779.
@@ -1761,6 +1764,9 @@ class Inspector extends EventEmitter {
}
this.#destroyed = true;
+ // Prevents any further action from being dispatched
+ this.store.dispatch(START_IGNORE_ACTION);
+
this.#cancelUpdate();
this.panelWin.removeEventListener("resize", this.onPanelWindowResize, true);