Bug 1403023 - Set mSentCommitOrAbort to true when HoldWorker call fails to silence the destructor assertion (this is a followup fix for bug 1399322). r=asuth, a=debug-only
authorJan Varga <jan.varga@gmail.com>
Fri, 29 Sep 2017 08:48:47 +0200
changeset 434449 6cbe936e07c21d7920976a10c764fcb9bd9b574c
parent 434448 0b50c7250aa635957c72a9e49eddc8b7cd65cdf6
child 434450 d1bb539f6325eb1f58d819316e9b99e46b1eaccc
push id1567
push userjlorenzo@mozilla.com
push dateThu, 02 Nov 2017 12:36:05 +0000
treeherdermozilla-release@e512c14a0406 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersasuth, debug-only
bugs1403023, 1399322
milestone57.0
Bug 1403023 - Set mSentCommitOrAbort to true when HoldWorker call fails to silence the destructor assertion (this is a followup fix for bug 1399322). r=asuth, a=debug-only
dom/indexedDB/IDBTransaction.cpp
--- a/dom/indexedDB/IDBTransaction.cpp
+++ b/dom/indexedDB/IDBTransaction.cpp
@@ -234,16 +234,21 @@ IDBTransaction::Create(JSContext* aCx, I
     WorkerPrivate* workerPrivate = GetCurrentThreadWorkerPrivate();
     MOZ_ASSERT(workerPrivate);
 
     workerPrivate->AssertIsOnWorkerThread();
 
     nsAutoPtr<WorkerHolder> workerHolder(
       new WorkerHolder(workerPrivate, transaction));
     if (NS_WARN_IF(!workerHolder->HoldWorker(workerPrivate, Canceling))) {
+      // Silence the destructor assertion if we never made this object live.
+#ifdef DEBUG
+      MOZ_ASSERT(!transaction->mSentCommitOrAbort);
+      transaction->mSentCommitOrAbort = true;
+#endif
       return nullptr;
     }
 
     transaction->mWorkerHolder = Move(workerHolder);
   }
 
   nsCOMPtr<nsIRunnable> runnable = do_QueryObject(transaction);
   nsContentUtils::RunInMetastableState(runnable.forget());