diff options
author | Joe Onorato <joeo@android.com> | 2010-03-23 17:34:37 -0400 |
---|---|---|
committer | Joe Onorato <joeo@android.com> | 2010-03-23 17:34:37 -0400 |
commit | 9690b396d5f24a31ce8ffd9739f1f5d03a69bdce (patch) | |
tree | 84c1241e2bf7e25326a2e375d9453269911f68fb /src/com/android/launcher2/LauncherProvider.java | |
parent | da6759fba8879e8fe3cf9548f4a48029eb18a1fb (diff) | |
download | packages_apps_trebuchet-9690b396d5f24a31ce8ffd9739f1f5d03a69bdce.zip packages_apps_trebuchet-9690b396d5f24a31ce8ffd9739f1f5d03a69bdce.tar.gz packages_apps_trebuchet-9690b396d5f24a31ce8ffd9739f1f5d03a69bdce.tar.bz2 |
fix 2533780 database cursors/statements is not closed in LauncherProvider.java
Change-Id: Iaf8ca76a15b153a1154b106247f81a0213183bcb
Diffstat (limited to 'src/com/android/launcher2/LauncherProvider.java')
-rw-r--r-- | src/com/android/launcher2/LauncherProvider.java | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/com/android/launcher2/LauncherProvider.java b/src/com/android/launcher2/LauncherProvider.java index 4bf4421..d50b19c 100644 --- a/src/com/android/launcher2/LauncherProvider.java +++ b/src/com/android/launcher2/LauncherProvider.java @@ -480,9 +480,10 @@ public class LauncherProvider extends ContentProvider { db.beginTransaction(); Cursor c = null; + SQLiteStatement update = null; try { boolean logged = false; - final SQLiteStatement update = db.compileStatement("UPDATE favorites " + update = db.compileStatement("UPDATE favorites " + "SET icon=? WHERE _id=?"); c = db.rawQuery("SELECT _id, icon FROM favorites WHERE iconType=" + @@ -506,8 +507,6 @@ public class LauncherProvider extends ContentProvider { update.execute(); } bitmap.recycle(); - //noinspection UnusedAssignment - bitmap = null; } } catch (Exception e) { if (!logged) { @@ -523,6 +522,9 @@ public class LauncherProvider extends ContentProvider { Log.w(TAG, "Problem while allocating appWidgetIds for existing widgets", ex); } finally { db.endTransaction(); + if (update != null) { + update.close(); + } if (c != null) { c.close(); } |