Bug 717694 - Persist prefs after closing the add-ons manager; r=Unfocused
authorGeoff Lankow <geoff@darktrojan.net>
Fri, 13 Jan 2012 15:07:52 +1300
changeset 84406 4a9747a88eab2a59133ba877bcc35c0f243e353c
parent 84405 9f00bf6379a6a7b30c14906cf56817a6f1cee562
child 84407 14804481337294895fc28dc09c8c15b2c742ede8
push id21848
push usermak77@bonardo.net
push dateSat, 14 Jan 2012 09:02:20 +0000
treeherdermozilla-central@27a7f197c6fc [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersUnfocused
bugs717694
milestone12.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 717694 - Persist prefs after closing the add-ons manager; r=Unfocused
toolkit/mozapps/extensions/content/extensions.js
--- a/toolkit/mozapps/extensions/content/extensions.js
+++ b/toolkit/mozapps/extensions/content/extensions.js
@@ -2796,16 +2796,20 @@ var gDetailView = {
 
   hide: function() {
     this._updatePrefs.removeObserver("", this);
     this.clearLoading();
     if (this._addon) {
       gEventManager.unregisterAddonListener(this, this._addon.id);
       gEventManager.unregisterInstallListener(this);
       this._addon = null;
+
+      // Flush the preferences to disk so they survive any crash
+      if (this.node.getElementsByTagName("setting").length)
+        Services.prefs.savePrefFile(null);
     }
   },
 
   updateState: function() {
     gViewController.updateCommands();
 
     var pending = this._addon.pendingOperations;
     if (pending != AddonManager.PENDING_NONE) {