Merge "accept close() on database objects even if the database is closed" into froyo
This commit is contained in:
@ -96,9 +96,6 @@ import android.util.Log;
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* package */ void releaseSqlStatement() {
|
/* 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
|
// Note that native_finalize() checks to make sure that nStatement is
|
||||||
// non-null before destroying it.
|
// non-null before destroying it.
|
||||||
if (nStatement != 0) {
|
if (nStatement != 0) {
|
||||||
|
@ -286,7 +286,7 @@ public abstract class SQLiteProgram extends SQLiteClosable {
|
|||||||
*/
|
*/
|
||||||
public void close() {
|
public void close() {
|
||||||
if (!mDatabase.isOpen()) {
|
if (!mDatabase.isOpen()) {
|
||||||
throw new IllegalStateException("database " + mDatabase.getPath() + " already closed");
|
return;
|
||||||
}
|
}
|
||||||
mDatabase.lock();
|
mDatabase.lock();
|
||||||
try {
|
try {
|
||||||
|
Reference in New Issue
Block a user