summaryrefslogtreecommitdiffstats
path: root/core/jni/android_database_SQLiteDatabase.cpp
diff options
context:
space:
mode:
authorVasu Nori <vnori@google.com>2010-05-21 15:36:06 -0700
committerVasu Nori <vnori@google.com>2010-05-21 15:41:58 -0700
commitfea6f6dcb70e3fa7f60cab970ed444b5e5e2a3fa (patch)
tree6eb558aaf41ecd905bd4c19b88f49711cf991200 /core/jni/android_database_SQLiteDatabase.cpp
parent3f21110a80bc414383d783540175f821027da0cc (diff)
downloadframeworks_base-fea6f6dcb70e3fa7f60cab970ed444b5e5e2a3fa.zip
frameworks_base-fea6f6dcb70e3fa7f60cab970ed444b5e5e2a3fa.tar.gz
frameworks_base-fea6f6dcb70e3fa7f60cab970ed444b5e5e2a3fa.tar.bz2
sqlite crashes when closing the database
A change was made in the last CL to ask sqlite for all unfinalized statements and then finalizing them before closing the database. But this crashes sqlite! because sqlite's FTS3 module keeps some prepared statements around and they should not be finalized before closing the database. (when sqlite is asked for all unfianlized statements, it also returns the FTS3's reserved prepared statements which should not be finalized!!) Change-Id: I141ab4563985b8cd1305a1228c4cb01bc7281bcb
Diffstat (limited to 'core/jni/android_database_SQLiteDatabase.cpp')
-rw-r--r--core/jni/android_database_SQLiteDatabase.cpp5
1 files changed, 0 insertions, 5 deletions
diff --git a/core/jni/android_database_SQLiteDatabase.cpp b/core/jni/android_database_SQLiteDatabase.cpp
index 3d2f54d..0c50c54 100644
--- a/core/jni/android_database_SQLiteDatabase.cpp
+++ b/core/jni/android_database_SQLiteDatabase.cpp
@@ -215,7 +215,6 @@ static void enableSqlProfiling(JNIEnv* env, jobject object, jstring databaseName
static void dbclose(JNIEnv* env, jobject object)
{
sqlite3 * handle = (sqlite3 *)env->GetIntField(object, offset_db_handle);
- sqlite3_stmt * pStmt;
if (handle != NULL) {
// release the memory associated with the traceFuncArg in enableSqlTracing function
@@ -228,10 +227,6 @@ static void dbclose(JNIEnv* env, jobject object)
if (traceFuncArg != NULL) {
free(traceFuncArg);
}
- // finalize all statements on this handle
- while ((pStmt = sqlite3_next_stmt(handle, 0)) != 0 ) {
- sqlite3_finalize(pStmt);
- }
LOGV("Closing database: handle=%p\n", handle);
int result = sqlite3_close(handle);
if (result == SQLITE_OK) {