Bug 904637: Only disconnect IndexDBParents once, r=bent
authorThomas Zimmermann <tdz@users.sourceforge.net>
Tue, 20 Aug 2013 10:27:30 +0200
changeset 143221 8709555732ea4920a5548e88b268290e870fc37c
parent 143220 099cfe7eca65e6e15cb02bc82132f1af17b013aa
child 143222 cf6f81f3ce8960eafedd630f33169677d1549c71
push id361
push usertdz@users.sourceforge.net
push dateTue, 20 Aug 2013 15:20:04 +0000
treeherderb2g-inbound@8709555732ea [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbent
bugs904637
milestone26.0a1
Bug 904637: Only disconnect IndexDBParents once, r=bent IndexDBParent::Disconnect can only be called once. During shutdown of an app, it can happen that Disconnect of an instance has been run before. In this case, we run from the Disconnect method immediately.
dom/indexedDB/ipc/IndexedDBParent.cpp
--- a/dom/indexedDB/ipc/IndexedDBParent.cpp
+++ b/dom/indexedDB/ipc/IndexedDBParent.cpp
@@ -77,17 +77,19 @@ IndexedDBParent::IndexedDBParent(TabPare
 IndexedDBParent::~IndexedDBParent()
 {
   MOZ_COUNT_DTOR(IndexedDBParent);
 }
 
 void
 IndexedDBParent::Disconnect()
 {
-  MOZ_ASSERT(!mDisconnected);
+  if (mDisconnected) {
+    return;
+  }
 
   mDisconnected = true;
 
   const InfallibleTArray<PIndexedDBDatabaseParent*>& databases =
     ManagedPIndexedDBDatabaseParent();
   for (uint32_t i = 0; i < databases.Length(); ++i) {
     static_cast<IndexedDBDatabaseParent*>(databases[i])->Disconnect();
   }