Bug 1069605 - Make sure settings lock exists before trying to remove it. r=bent, a=bajaj
authorKyle Machulis <kyle@nonpolynomial.com>
Thu, 18 Sep 2014 17:23:27 -0700
changeset 225013 a42a0e6d65fa6ac28cd34752106ffdd92a0fa527
parent 225012 a7ad950df755afa446e7ed0a51a20034812fe40e
child 225014 30ce89bae09cc7582eab8fe075782b9a3d4a43da
push id3979
push userraliiev@mozilla.com
push dateMon, 13 Oct 2014 16:35:44 +0000
treeherdermozilla-beta@30f2cc610691 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbent, bajaj
bugs1069605
milestone34.0a2
Bug 1069605 - Make sure settings lock exists before trying to remove it. r=bent, a=bajaj
dom/settings/SettingsRequestManager.jsm
--- a/dom/settings/SettingsRequestManager.jsm
+++ b/dom/settings/SettingsRequestManager.jsm
@@ -714,29 +714,31 @@ let SettingsRequestManager = {
         i = i + 1;
       }
       debug("Principal/MessageManager pairs left: " + i);
     }
   },
 
   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) {