Bug 1069605 - Make sure settings lock exists before trying to remove it; r=bent
authorKyle Machulis <kyle@nonpolynomial.com>
Thu, 18 Sep 2014 17:23:27 -0700
changeset 206107 674e62d19031dfb8ce6fa10c19978e22ed51a7bc
parent 206106 ba79aa341f3424cc69fb6b6ff39c2cd869ad3d9e
child 206108 c0d87c64eef228e40627b030407387c214ff867b
push id27512
push usercbook@mozilla.com
push dateFri, 19 Sep 2014 12:07:02 +0000
treeherdermozilla-central@c8dee1c9cc3d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbent
bugs1069605
milestone35.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 1069605 - Make sure settings lock exists before trying to remove it; r=bent
dom/settings/SettingsRequestManager.jsm
--- a/dom/settings/SettingsRequestManager.jsm
+++ b/dom/settings/SettingsRequestManager.jsm
@@ -706,29 +706,31 @@ let SettingsRequestManager = {
       this.children.splice(index, 1);
       this.mmPrincipals.delete(aMsgMgr);
     }
     if (DEBUG) debug("Principal/MessageManager pairs left: " + this.mmPrincipals.size);
   },
 
   removeLock: function(aLockID) {
     if (DEBUG) debug("Removing lock " + aLockID);
+    if (this.lockInfo[aLockID]) {
     let transaction = this.lockInfo[aLockID]._transaction;
     if (transaction) {
       try {
         transaction.abort();
       } catch (e) {
         if (e.name == "InvalidStateError") {
           if (DEBUG) debug("Transaction for " + aLockID + " closed already");
         } else {
           throw e;
         }
       }
     }
     delete this.lockInfo[aLockID];
+    }
     let index = this.settingsLockQueue.indexOf(aLockID);
     if (index > -1) {
       this.settingsLockQueue.splice(index, 1);
     }
     // If index is 0, the lock we just removed was at the head of
     // the queue, so possibly queue the next lock if it's
     // consumable.
     if (index == 0) {