diff options
author | Ken Shirriff <kens@google.com> | 2010-03-12 14:31:16 -0800 |
---|---|---|
committer | Ken Shirriff <kens@google.com> | 2010-03-12 14:31:16 -0800 |
commit | 29c228e07443ed8ef2e04bb2d070260ac4135448 (patch) | |
tree | f1766db73e5dc44db518c4b817e4d3614a668251 | |
parent | ce8efead60282bedf0383bee83c7583b7332791d (diff) | |
download | frameworks_base-29c228e07443ed8ef2e04bb2d070260ac4135448.zip frameworks_base-29c228e07443ed8ef2e04bb2d070260ac4135448.tar.gz frameworks_base-29c228e07443ed8ef2e04bb2d070260ac4135448.tar.bz2 |
Make sure Browser cursors are closed
finalizer errors were occurring due to unclosed cursors, maybe
causing ANRs.
Change-Id: Ibe75f7dbe7b591023a1560a5ffbfe84fac694ef2
-rw-r--r-- | core/java/android/provider/Browser.java | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/core/java/android/provider/Browser.java b/core/java/android/provider/Browser.java index a5c85c1..4377a2b 100644 --- a/core/java/android/provider/Browser.java +++ b/core/java/android/provider/Browser.java @@ -363,7 +363,7 @@ public class Browser { str[i] = c.getString(0); i++; } - c.deactivate(); + c.close(); return str; } catch (IllegalStateException e) { return new String[0]; @@ -402,7 +402,7 @@ public class Browser { if (!c.moveToNext()) break; } } - c.deactivate(); + c.close(); } catch (IllegalStateException e) { Log.e(LOGTAG, "truncateHistory", e); return; @@ -427,7 +427,7 @@ public class Browser { null ); boolean ret = c.moveToFirst(); - c.deactivate(); + c.close(); return ret; } catch (IllegalStateException e) { return false; @@ -462,7 +462,7 @@ public class Browser { null, null); if (!c.moveToFirst()) { - c.deactivate(); + c.close(); return; } @@ -489,7 +489,7 @@ public class Browser { iconDb.releaseIconForPageUrl(url); } } while (c.moveToNext()); - c.deactivate(); + c.close(); if (!firstTime) { ContentValues map = new ContentValues(); @@ -576,7 +576,7 @@ public class Browser { } else { cr.insert(SEARCHES_URI, map); } - c.deactivate(); + c.close(); } catch (IllegalStateException e) { Log.e(LOGTAG, "addSearchUrl", e); return; |