From f6373e9513002f55bbe00180a5eb9f1051d53547 Mon Sep 17 00:00:00 2001 From: Vasu Nori Date: Tue, 16 Mar 2010 10:21:00 -0700 Subject: close() database should close the db no matter what the ref count says bug:2455416 Change-Id: Ia995c952c6941fbaa016c5b251e4980fa5328fbb --- core/java/android/database/sqlite/SQLiteDatabase.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'core/java/android/database') diff --git a/core/java/android/database/sqlite/SQLiteDatabase.java b/core/java/android/database/sqlite/SQLiteDatabase.java index b232ff9..e6f9bed 100644 --- a/core/java/android/database/sqlite/SQLiteDatabase.java +++ b/core/java/android/database/sqlite/SQLiteDatabase.java @@ -852,7 +852,11 @@ public class SQLiteDatabase extends SQLiteClosable { lock(); try { closeClosable(); - releaseReference(); + // close this database instance - regardless of its reference count value + onAllReferencesReleased(); + // set path to null, to cause bad stuff to happen if this object is reused without + // being opened first + mPath = null; } finally { unlock(); } -- cgit v1.1