Bug 1018089 - Close the SQLiteBridge Cursor in getVersion(). r=gcp
authorShashank Sabniveesu <shashank@linux.com>
Tue, 03 Jun 2014 03:01:00 -0400
changeset 186327 509dcb2fd26b551deaf8f3ad513e42e660467b5e
parent 186326 81d79924f919ff293cedd87e80d2376cc7d2f51c
child 186328 816084978ed14216fd76c2ea83cefe4c2bc62a13
push id7114
push userryanvm@gmail.com
push dateTue, 03 Jun 2014 14:42:35 +0000
treeherderfx-team@993e88c0c67e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgcp
bugs1018089
milestone32.0a1
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)