From 15df2c2f4ba0c19404cd310760962ca0ec1c1830 Mon Sep 17 00:00:00 2001 From: "Carsten \"Tomcat\" Book" Date: Wed, 14 Oct 2015 14:29:37 +0200 Subject: [PATCH] Backed out changeset 2387ada86428 (bug 1203803) for landing with negative review and causing assertions --- dom/indexedDB/ActorsParent.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/dom/indexedDB/ActorsParent.cpp b/dom/indexedDB/ActorsParent.cpp index 39a22f6c716d..37e1ef49689a 100644 --- a/dom/indexedDB/ActorsParent.cpp +++ b/dom/indexedDB/ActorsParent.cpp @@ -20130,9 +20130,13 @@ FactoryOp::ActorDestroy(ActorDestroyReason aWhy) NoteActorDestroyed(); - if (mState == State::WaitingForTransactionsToComplete || - (mState == State::SendingResults && aWhy != Deletion)) { - // We didn't get an opportunity to clean up. Do that now. + // 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) { mState = State::SendingResults; IDB_REPORT_INTERNAL_ERR(); mResultCode = NS_ERROR_DOM_INDEXEDDB_UNKNOWN_ERR;