Bug 448114 - Notify about non-finalized statements in debug builds

r=asuth
This commit is contained in:
Shawn Wilsher 2008-12-08 17:14:14 -05:00
Родитель 172f8ce69d
Коммит ab6e04edbe
2 изменённых файлов: 13 добавлений и 1 удалений

Просмотреть файл

@ -114,6 +114,7 @@ EXPORTS
sqlite3_mutex_leave
sqlite3_mutex_try
sqlite3_mprintf
sqlite3_next_stmt
sqlite3_open
sqlite3_open_v2
sqlite3_open16

Просмотреть файл

@ -240,6 +240,17 @@ mozStorageConnection::Close()
}
}
#ifdef DEBUG
// Notify about any non-finalized statements.
sqlite3_stmt *stmt = NULL;
while (stmt = sqlite3_next_stmt(mDBConn, stmt)) {
char *msg = PR_smprintf("SQL statement '%s' was not finalized",
sqlite3_sql(stmt));
NS_WARNING(msg);
PR_smprintf_free(msg);
}
#endif
{
nsAutoLock mutex(mProgressHandlerMutex);
if (mProgressHandler)
@ -248,7 +259,7 @@ mozStorageConnection::Close()
int srv = sqlite3_close(mDBConn);
if (srv != SQLITE_OK)
NS_WARNING("sqlite3_close failed. There are probably outstanding statements!");
NS_WARNING("sqlite3_close failed. There are probably outstanding statements that are listed above!");
mDBConn = NULL;
return ConvertResultCode(srv);