[Pkg-mozext-commits] [firebug] 12/35: Remove timeouts after panels are destroyed (some panels can create new timeouts in destroy)

David Prévot taffit at moszumanska.debian.org
Sat May 24 14:54:27 UTC 2014


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository firebug.

commit 41261a7ee4f8581fa0b3593bfeec45aa41efbc44
Author: Jan Odvarko <odvarko at gmail.com>
Date:   Wed May 21 14:12:29 2014 +0200

    Remove timeouts after panels are destroyed (some panels can create new timeouts in destroy)
---
 extension/content/firebug/chrome/tabContext.js | 32 +++++++++++++-------------
 1 file changed, 16 insertions(+), 16 deletions(-)

diff --git a/extension/content/firebug/chrome/tabContext.js b/extension/content/firebug/chrome/tabContext.js
index 21bae0e..862779b 100644
--- a/extension/content/firebug/chrome/tabContext.js
+++ b/extension/content/firebug/chrome/tabContext.js
@@ -280,6 +280,22 @@ TabContext.prototype =
 
     destroy: function(state)
     {
+        state.panelState = {};
+
+        // Inherit panelStates that have not been restored yet
+        if (this.persistedState)
+        {
+            for (var panelName in this.persistedState.panelState)
+                state.panelState[panelName] = this.persistedState.panelState[panelName];
+        }
+
+        // Destroy all panels in this context.
+        for (var panelName in this.panelMap)
+        {
+            var panelType = Firebug.getPanelType(panelName);
+            this.destroyPanel(panelType, state);
+        }
+
         // All existing timeouts need to be cleared. This is why it's recommended
         // to always create timeouts through the context object. It ensures that
         // all timeouts and intervals are cleared when the context is destroyed.
@@ -326,22 +342,6 @@ TabContext.prototype =
         // We should avoid these exceptions (even if they are not representing memory leaks)
         this.unregisterAllListeners();
 
-        state.panelState = {};
-
-        // Inherit panelStates that have not been restored yet
-        if (this.persistedState)
-        {
-            for (var panelName in this.persistedState.panelState)
-                state.panelState[panelName] = this.persistedState.panelState[panelName];
-        }
-
-        // Destroy all panels in this context.
-        for (var panelName in this.panelMap)
-        {
-            var panelType = Firebug.getPanelType(panelName);
-            this.destroyPanel(panelType, state);
-        }
-
         Trace.sysout("tabContext.destroy; " + this.getName() + " set state ", state);
     },
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/firebug.git



More information about the Pkg-mozext-commits mailing list