From c5b9c0a74d04003a8e5870418d68200c3cccc847 Mon Sep 17 00:00:00 2001 From: "smfr%smfr.org" Date: Thu, 3 Feb 2005 05:54:17 +0000 Subject: [PATCH] Add some HISTORY DEBUG logging on DB close as well. --- camino/src/history/nsSimpleGlobalHistory.cpp | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/camino/src/history/nsSimpleGlobalHistory.cpp b/camino/src/history/nsSimpleGlobalHistory.cpp index f16150217abe..695eac579b9e 100644 --- a/camino/src/history/nsSimpleGlobalHistory.cpp +++ b/camino/src/history/nsSimpleGlobalHistory.cpp @@ -2068,11 +2068,16 @@ nsSimpleGlobalHistory::Commit(eCommitType commitType) err = thumb->DoMore(mEnv, &total, ¤t, &done, &broken); } while ((err == 0) && !broken && !done); } + +#ifdef DEBUG_HISTORY + if (err != 0) + fprintf(stderr, "HISTORY DEBUG: Commit() encountered error 0x08%x\n", err); +#endif + if (err != 0) // mork doesn't return NS error codes. Yet. return NS_ERROR_FAILURE; - else - return NS_OK; + return NS_OK; } // if notify is true, we'll notify rdf of deleted rows. @@ -2153,6 +2158,9 @@ nsSimpleGlobalHistory::CloseDB() ExpireEntries(PR_FALSE /* don't notify */); err = Commit(kSessionCommit); +#ifdef DEBUG_HISTORY + fprintf(stderr, "HISTORY DEBUG: Commit() in CloseDB() returned error 0x%08x\n", err); +#endif // order is important here - logically smallest objects first mMetaRow = nsnull; @@ -2165,7 +2173,9 @@ nsSimpleGlobalHistory::CloseDB() if (mEnv) mEnv->Release(); - mTable = nsnull; mEnv = nsnull; mStore = nsnull; + mTable = nsnull; + mEnv = nsnull; + mStore = nsnull; return NS_OK; }