when closing db, close all pending statements also

Change-Id: Ia543933e0cd70852c4e60623de698bb51b976900
This commit is contained in:
Vasu Nori
2010-06-14 16:58:47 -07:00
parent 4ed8e42c50
commit ad239ab8fa

View File

@ -365,7 +365,8 @@ public class SQLiteDatabase extends SQLiteClosable {
@Override @Override
protected void onAllReferencesReleased() { protected void onAllReferencesReleased() {
if (isOpen()) { if (isOpen()) {
dbclose(); // close the database which will close all pending statements to be finalized also
close();
} }
} }
@ -1042,7 +1043,7 @@ public class SQLiteDatabase extends SQLiteClosable {
// finalize ALL statements queued up so far // finalize ALL statements queued up so far
closePendingStatements(); closePendingStatements();
// close this database instance - regardless of its reference count value // close this database instance - regardless of its reference count value
onAllReferencesReleased(); dbclose();
if (mConnectionPool != null) { if (mConnectionPool != null) {
mConnectionPool.close(); mConnectionPool.close();
} }