From 6dc8a7d8133f06bb9db174ed67d491a521d29adf Mon Sep 17 00:00:00 2001 From: FranklinDM Date: Sat, 18 Feb 2023 14:34:56 +0800 Subject: [PATCH] Issue #1382 - Annotate crash with database name when storage connection not closed Reported on https://bugzilla.mozilla.org/show_bug.cgi?id=1384036 This was fixed with an unrelated issue: https://bugzilla.mozilla.org/show_bug.cgi?id=1372823 --- storage/mozStorageService.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/storage/mozStorageService.cpp b/storage/mozStorageService.cpp index 8c6f65232c..04be1f8733 100644 --- a/storage/mozStorageService.cpp +++ b/storage/mozStorageService.cpp @@ -27,7 +27,7 @@ #include "sqlite3.h" -#ifdef SQLITE_OS_WIN +#ifdef XP_WIN // "windows.h" was included and it can #define lots of things we care about... #undef CompareString #endif @@ -917,6 +917,12 @@ Service::Observe(nsISupports *, const char *aTopic, const char16_t *) getConnections(connections); for (uint32_t i = 0, n = connections.Length(); i < n; i++) { if (!connections[i]->isClosed()) { +#ifdef DEBUG + nsCString msg; + msg.AppendPrintf("Storage connection to '%s' was not closed.", + connections[i]->getFilename().get()); + NS_ERROR(msg.get()); +#endif MOZ_CRASH(); } }