Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Ensure Application.storage available
Can be not accessible from closed window
  • Loading branch information
Infocatcher committed Sep 4, 2012
1 parent 29ed49b commit 4f00a9f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Cookies_Permissions/cookiesPermissions.js
Expand Up @@ -372,6 +372,7 @@ this.permissions = {
timerId: timerId,
interval: interval,
permissions: this,
storage: Application.storage, // Object from closed window can be not available, so cache it
get timer() {
delete this.timer;
return this.timer = Components.classes["@mozilla.org/timer;1"]
Expand All @@ -385,7 +386,7 @@ this.permissions = {
destroy: function() {
this.permissions.oSvc.removeObserver(this, "quit-application-granted");
this.timer.cancel();
Application.storage.set(this.timerId, null);
this.storage.set(this.timerId, null);
this.permissions = null;
},
handleEvent: function(e) {
Expand Down

0 comments on commit 4f00a9f

Please sign in to comment.