Bug 1018089 - Close the SQLiteBridge Cursor in getVersion(). r=gcp
authorShashank Sabniveesu <shashank@linux.com>
Tue, 03 Jun 2014 03:01:00 -0400
changeset 205550 509dcb2fd26b551deaf8f3ad513e42e660467b5e
parent 205549 81d79924f919ff293cedd87e80d2376cc7d2f51c
child 205551 816084978ed14216fd76c2ea83cefe4c2bc62a13
push id3741
push userasasaki@mozilla.com
push dateMon, 21 Jul 2014 20:25:18 +0000
treeherdermozilla-beta@4d6f46f5af68 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgcp
bugs1018089
milestone32.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1018089 - Close the SQLiteBridge Cursor in getVersion(). r=gcp
mobile/android/base/sqlite/SQLiteBridge.java
--- a/mobile/android/base/sqlite/SQLiteBridge.java
+++ b/mobile/android/base/sqlite/SQLiteBridge.java
@@ -222,16 +222,17 @@ public class SQLiteBridge {
     public int getVersion()
                throws SQLiteBridgeException {
         Cursor cursor = internalQuery("PRAGMA user_version", null);
         int ret = -1;
         if (cursor != null) {
             cursor.moveToFirst();
             String version = cursor.getString(0);
             ret = Integer.parseInt(version);
+            cursor.close();
         }
         return ret;
     }
 
     // Do an SQL query, substituting the parameters in the query with the passed
     // parameters. The parameters are substituted in order: named parameters
     // are not supported.
     private Cursor internalQuery(String aQuery, String[] aParams)