diff options
Diffstat (limited to 'components/script/dom/window.rs')
-rw-r--r-- | components/script/dom/window.rs | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/components/script/dom/window.rs b/components/script/dom/window.rs index 87c80ce62d0..0c3a2db0899 100644 --- a/components/script/dom/window.rs +++ b/components/script/dom/window.rs @@ -1389,7 +1389,18 @@ impl Window { self.current_state.set(WindowState::Zombie); *self.js_runtime.borrow_mut() = None; - self.window_proxy.set(None); + + // If this is the currently active pipeline, + // nullify the window_proxy. + if let Some(proxy) = self.window_proxy.get() { + let pipeline_id = self.upcast::<GlobalScope>().pipeline_id(); + if let Some(currently_active) = proxy.currently_active() { + if currently_active == pipeline_id { + self.window_proxy.set(None); + } + } + } + if let Some(performance) = self.performance.get() { performance.clear_and_disable_performance_entry_buffer(); } |