| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -31,9 +31,19 @@ class SQLCipherMethodHandler implements MethodCallHandler { | |||
| 31 | 31 | ||
| 32 | 32 | case "getVersion": { | |
| 33 | 33 | final SQLiteDatabase db = SQLiteDatabase.openOrCreateDatabase(":memory:", (String)null, null); | |
| 34 | - final Cursor cursor = db.rawQuery("PRAGMA cipher_version", null); | ||
| 35 | - cursor.moveToNext(); | ||
| 36 | - result.success(cursor.getString(0)); | ||
| 34 | + try { | ||
| 35 | + final Cursor cursor = db.rawQuery("PRAGMA cipher_version", null); | ||
| 36 | + try { | ||
| 37 | + cursor.moveToNext(); | ||
| 38 | + result.success(cursor.getString(0)); | ||
| 39 | + } | ||
| 40 | + finally { | ||
| 41 | + cursor.close(); | ||
| 42 | + } | ||
| 43 | + } | ||
| 44 | + finally { | ||
| 45 | + db.close(); | ||
| 46 | + } | ||
| 37 | 47 | break; | |
| 38 | 48 | } | |
| 39 | 49 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -31,9 +31,19 @@ class SQLiteMethodHandler implements MethodCallHandler { | |||
| 31 | 31 | ||
| 32 | 32 | case "getVersion": { | |
| 33 | 33 | final SQLiteDatabase db = SQLiteDatabase.openOrCreateDatabase(":memory:", (String)null, null); | |
| 34 | - final Cursor cursor = db.rawQuery("SELECT sqlite_version()", null); | ||
| 35 | - cursor.moveToNext(); | ||
| 36 | - result.success(cursor.getString(0)); | ||
| 34 | + try { | ||
| 35 | + final Cursor cursor = db.rawQuery("SELECT sqlite_version()", null); | ||
| 36 | + try { | ||
| 37 | + cursor.moveToNext(); | ||
| 38 | + result.success(cursor.getString(0)); | ||
| 39 | + } | ||
| 40 | + finally { | ||
| 41 | + cursor.close(); | ||
| 42 | + } | ||
| 43 | + } | ||
| 44 | + finally { | ||
| 45 | + db.close(); | ||
| 46 | + } | ||
| 37 | 47 | break; | |
| 38 | 48 | } | |
| 39 | 49 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments