mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 05:41:12 +00:00
Bug 1598559 - Do not forget runnable within loop. r=dom-workers-and-storage-reviewers,janv
Reverts regression introduced by 449a5f02a960116e0f901ae3570170ab642ecea0. Differential Revision: https://phabricator.services.mozilla.com/D54497 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
1ac11b47bd
commit
4006617c93
@ -11422,7 +11422,13 @@ bool ConnectionPool::ScheduleTransaction(TransactionInfo* aTransactionInfo,
|
||||
// We need a thread right now so force all idle processing to stop by
|
||||
// posting a dummy runnable to each thread that might be doing idle
|
||||
// maintenance.
|
||||
nsCOMPtr<nsIRunnable> runnable = new Runnable("IndexedDBDummyRunnable");
|
||||
//
|
||||
// This is copied for each database inside the loop below, it is
|
||||
// deliberately const to prevent the attempt to wrongly optimize the
|
||||
// refcounting by passing runnable.forget() to the Dispatch method, see
|
||||
// bug 1598559.
|
||||
const nsCOMPtr<nsIRunnable> runnable =
|
||||
new Runnable("IndexedDBDummyRunnable");
|
||||
|
||||
for (uint32_t index = mDatabasesPerformingIdleMaintenance.Length();
|
||||
index > 0; index--) {
|
||||
@ -11431,7 +11437,7 @@ bool ConnectionPool::ScheduleTransaction(TransactionInfo* aTransactionInfo,
|
||||
MOZ_ASSERT(dbInfo->mThreadInfo.mThread);
|
||||
|
||||
MOZ_ALWAYS_SUCCEEDS(dbInfo->mThreadInfo.mThread->Dispatch(
|
||||
runnable.forget(), NS_DISPATCH_NORMAL));
|
||||
runnable, NS_DISPATCH_NORMAL));
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user