accept close() on database objects even if the database is closed

bug:2602878
Change-Id: I3075f801ef35d72792ff3daaa1e887e53b58f5f8
This commit is contained in:
Vasu Nori
2010-04-16 14:24:57 -07:00
parent f066611aab
commit 0dbb9cee58
2 changed files with 1 additions and 4 deletions

View File

@@ -96,9 +96,6 @@ import android.util.Log;
}
/* package */ void releaseSqlStatement() {
if (!mDatabase.isOpen()) {
throw new IllegalStateException("database " + mDatabase.getPath() + " already closed");
}
// Note that native_finalize() checks to make sure that nStatement is
// non-null before destroying it.
if (nStatement != 0) {

View File

@@ -286,7 +286,7 @@ public abstract class SQLiteProgram extends SQLiteClosable {
*/
public void close() {
if (!mDatabase.isOpen()) {
throw new IllegalStateException("database " + mDatabase.getPath() + " already closed");
return;
}
mDatabase.lock();
try {