diff options
| author | 2010-01-08 09:21:31 -0800 | |
|---|---|---|
| committer | 2010-01-08 09:21:31 -0800 | |
| commit | 02a018f0b5479ab102f6539bb8bad75c1e935102 (patch) | |
| tree | 6978c0cc36bcc208185a51e415645e799d261255 | |
| parent | c2a5d96b5d415ac3f135903881e872f0354d6435 (diff) | |
| parent | 42960e8ddf443f81ceadb9f9390707768d68ab7f (diff) | |
Merge "when finalizing SQLiteCursor, close it but don't throw exceptions."
| -rw-r--r-- | core/java/android/database/sqlite/SQLiteCursor.java | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/core/java/android/database/sqlite/SQLiteCursor.java b/core/java/android/database/sqlite/SQLiteCursor.java index 70b9b835b5bb..b178d4f333b8 100644 --- a/core/java/android/database/sqlite/SQLiteCursor.java +++ b/core/java/android/database/sqlite/SQLiteCursor.java @@ -582,21 +582,23 @@ public class SQLiteCursor extends AbstractWindowedCursor { @Override protected void finalize() { try { + // if the cursor hasn't been closed yet, close it first if (mWindow != null) { close(); - String message = "Finalizing cursor " + this + " on " + mEditTable - + " that has not been deactivated or closed"; + Log.e(TAG, "Finalizing cursor that has not been deactivated or closed." + + " database = " + mDatabase.getPath() + ", table = " + mEditTable + + ", query = " + mQuery.mSql); if (SQLiteDebug.DEBUG_ACTIVE_CURSOR_FINALIZATION) { - Log.d(TAG, message + "\nThis cursor was created in:"); + Log.d(TAG, "This cursor was created in:"); for (StackTraceElement ste : mStackTraceElements) { Log.d(TAG, " " + ste); } } SQLiteDebug.notifyActiveCursorFinalized(); - throw new IllegalStateException(message); } else { if (Config.LOGV) { - Log.v(TAG, "Finalizing cursor " + this + " on " + mEditTable); + Log.v(TAG, "Finalizing cursor on database = " + mDatabase.getPath() + + ", table = " + mEditTable + ", query = " + mQuery.mSql); } } } finally { |