Bug 1203803: Force cleanup for specific states only; r=khuey a=lizzard
authorJan Varga <jan.varga@gmail.com>
Tue, 13 Oct 2015 10:19:43 -0700
changeset 296595 52dae964a9ed3a641e74ab6f9e0e35e5a53d4dca
parent 296594 72b0db9ced18d80b2cda32e8fb7a337ec7221aeb
child 296596 256f6ecf9437fdecc874fe43e95ceb07a456c178
push id5245
push userraliiev@mozilla.com
push dateThu, 29 Oct 2015 11:30:51 +0000
treeherdermozilla-beta@dac831dc1bd0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskhuey, lizzard
bugs1203803
milestone43.0a2
Bug 1203803: Force cleanup for specific states only; r=khuey a=lizzard
dom/indexedDB/ActorsParent.cpp
--- a/dom/indexedDB/ActorsParent.cpp
+++ b/dom/indexedDB/ActorsParent.cpp
@@ -20110,23 +20110,19 @@ FactoryOp::DirectoryLockFailed()
 
 void
 FactoryOp::ActorDestroy(ActorDestroyReason aWhy)
 {
   AssertIsOnBackgroundThread();
 
   NoteActorDestroyed();
 
-  // There may be an event in the event queue that would do the cleanup later,
-  // but if we are being destroyed abnormally (not by calling
-  // PBackgroundIDBFactoryRequestParent::Send__delete__) we need to do the
-  // cleanup here and just ignore the cleanup event in FactoryOp::Run.
-  // Otherwise some Database objects may be still alive and registered in
-  // gLiveDatabaseHashtable at the time the last factory is destroyed.
-  if (aWhy != Deletion) {
+  if (mState == State::WaitingForTransactionsToComplete ||
+      (mState == State::SendingResults && aWhy != Deletion)) {
+    // We didn't get an opportunity to clean up.  Do that now.
     mState = State::SendingResults;
     IDB_REPORT_INTERNAL_ERR();
     mResultCode = NS_ERROR_DOM_INDEXEDDB_UNKNOWN_ERR;
     SendResults();
   }
 }
 
 bool