Bug 1245615 - Nullify hostVsStores only after event unregistration to prevent exceptions. r=mratcliffe
authorAlexandre Poirot <poirot.alex@gmail.com>
Tue, 09 Feb 2016 02:50:16 -0800
changeset 329839 0d49792ec539b466c2489718ba785c202036cdef
parent 329838 a88ca50a3ed51f8a7592bae17c7cfc16c51b33d9
child 329840 e417e32d9cb698fe0b2e376d9cdeac0c2cffb43f
push id10617
push userdtownsend@mozilla.com
push dateTue, 09 Feb 2016 16:30:19 +0000
reviewersmratcliffe
bugs1245615
milestone47.0a1
Bug 1245615 - Nullify hostVsStores only after event unregistration to prevent exceptions. r=mratcliffe
devtools/server/actors/storage.js
--- a/devtools/server/actors/storage.js
+++ b/devtools/server/actors/storage.js
@@ -208,23 +208,23 @@ StorageActors.defaults = function(typeNa
       }
       this.onWindowReady = this.onWindowReady.bind(this);
       this.onWindowDestroyed = this.onWindowDestroyed.bind(this);
       events.on(this.storageActor, "window-ready", this.onWindowReady);
       events.on(this.storageActor, "window-destroyed", this.onWindowDestroyed);
     },
 
     destroy: function() {
-      this.hostVsStores = null;
       if (observationTopic) {
         Services.obs.removeObserver(this, observationTopic, false);
       }
       events.off(this.storageActor, "window-ready", this.onWindowReady);
       events.off(this.storageActor, "window-destroyed", this.onWindowDestroyed);
 
+      this.hostVsStores = null;
       this.storageActor = null;
     },
 
     getNamesForHost: function(host) {
       return [...this.hostVsStores.get(host).keys()];
     },
 
     getValuesForHost: function(host, name) {