Bug 973780 - Don't double-unregister during IDB teardown. r=khuey
authorBobby Holley <bobbyholley@gmail.com>
Fri, 21 Feb 2014 11:35:49 -0800
changeset 170280 468d3ce7f848757d47880b92250544b76ca44b69
parent 170279 913cb7066263ab104f5917d82e82ad0c981df219
child 170281 5b5af9a67885a19761c8bc5293c68bd32843d0fb
push id270
push userpvanderbeken@mozilla.com
push dateThu, 06 Mar 2014 09:24:21 +0000
reviewerskhuey
bugs973780
milestone30.0a1
Bug 973780 - Don't double-unregister during IDB teardown. r=khuey
dom/indexedDB/IDBDatabase.cpp
--- a/dom/indexedDB/IDBDatabase.cpp
+++ b/dom/indexedDB/IDBDatabase.cpp
@@ -389,17 +389,17 @@ IDBDatabase::OnUnlink()
   NS_ASSERTION(NS_IsMainThread(), "Wrong thread!");
 
   // We've been unlinked, at the very least we should be able to prevent further
   // transactions from starting and unblock any other SetVersion callers.
   CloseInternal(true);
 
   // No reason for the QuotaManager to track us any longer.
   QuotaManager* quotaManager = QuotaManager::Get();
-  if (quotaManager) {
+  if (mRegistered && quotaManager) {
     quotaManager->UnregisterStorage(this);
 
     // Don't try to unregister again in the destructor.
     mRegistered = false;
   }
 }
 
 already_AddRefed<IDBObjectStore>