Issue #2672 - Part 4: Prevent db access while rebuilding is underway.

This commit is contained in:
Moonchild 2024-12-22 16:58:11 +01:00 committed by roytam1
commit d69e2a3779

View file

@ -1577,6 +1577,7 @@ nsCookieService::CloseDBStates()
CleanupDefaultDBConnection();
mDefaultDBState = nullptr;
mInitializedDBConn = false;
mInitializedDBStates = false;
}
@ -1614,8 +1615,6 @@ nsCookieService::CleanupDefaultDBConnection()
mDefaultDBState->updateListener = nullptr;
mDefaultDBState->removeListener = nullptr;
mDefaultDBState->closeListener = nullptr;
mInitializedDBConn = false;
}
void
@ -1764,7 +1763,7 @@ nsCookieService::RebuildCorruptDB(DBState* aDBState)
os->NotifyObservers(nullptr, "cookie-db-rebuilding", nullptr);
}
gCookieService->InitDBConn();
gCookieService->InitDBConnInternal();
// Enumerate the hash, and add cookies to the params array.
mozIStorageAsyncStatement* stmt = gCookieService->mDefaultDBState->stmtInsert;