diff --git a/dom/indexedDB/ActorsParent.cpp b/dom/indexedDB/ActorsParent.cpp index 66ffc5ed672..ad44a4eddb6 100644 --- a/dom/indexedDB/ActorsParent.cpp +++ b/dom/indexedDB/ActorsParent.cpp @@ -11070,10 +11070,6 @@ Factory::Create(const LoggingInfo& aLoggingInfo) // If this is the first instance then we need to do some initialization. if (!sFactoryInstanceCount) { - if (!gConnectionPool) { - gConnectionPool = new ConnectionPool(); - } - MOZ_ASSERT(!gLiveDatabaseHashtable); gLiveDatabaseHashtable = new DatabaseActorHashtable(); @@ -11905,6 +11901,10 @@ Database::RecvPBackgroundIDBTransactionConstructor( return true; } + if (!gConnectionPool) { + gConnectionPool = new ConnectionPool(); + } + auto* transaction = static_cast(aActor); nsRefPtr startOp = new StartTransactionOp(transaction); @@ -17775,6 +17775,10 @@ OpenDatabaseOp::DispatchToWorkThread() return NS_ERROR_OUT_OF_MEMORY; } + if (!gConnectionPool) { + gConnectionPool = new ConnectionPool(); + } + nsRefPtr versionChangeOp = new VersionChangeOp(this); uint64_t transactionId =