зеркало из https://github.com/mozilla/pjs.git
Bug 448114 - Notify about non-finalized statements in debug builds
r=asuth
This commit is contained in:
Родитель
172f8ce69d
Коммит
ab6e04edbe
|
@ -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);
|
||||
|
|
Загрузка…
Ссылка в новой задаче