Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4e0b1a7e authored by Vasu Nori's avatar Vasu Nori Committed by Android (Google) Code Review
Browse files

Merge "sqlite crashes when closing the database"

parents f7b4150a fea6f6dc
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -926,6 +926,8 @@ public class SQLiteDatabase extends SQLiteClosable {
        lock();
        try {
            closeClosable();
            // finalize ALL statements queued up so far
            closePendingStatements();
            // close this database instance - regardless of its reference count value
            onAllReferencesReleased();
        } finally {
+0 −5
Original line number Diff line number Diff line
@@ -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) {