diff options
| author | Vasu Nori <vnori@google.com> | 2009-12-01 14:16:24 -0800 |
|---|---|---|
| committer | Vasu Nori <vnori@google.com> | 2009-12-01 14:16:24 -0800 |
| commit | b1dd3235a901e4c3c51ed910e29e0afa15fddb19 (patch) | |
| tree | 6f1470c84aa25ff38419d1e88c2b32992bc104af /core/java/android/database | |
| parent | ed90811e711065bcc82a45f4173587cd95ef6b6f (diff) | |
fix NPE. don't release an already released compiledSql obj
Diffstat (limited to 'core/java/android/database')
| -rw-r--r-- | core/java/android/database/sqlite/SQLiteProgram.java | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/core/java/android/database/sqlite/SQLiteProgram.java b/core/java/android/database/sqlite/SQLiteProgram.java index 041832465125..edc15cb0d824 100644 --- a/core/java/android/database/sqlite/SQLiteProgram.java +++ b/core/java/android/database/sqlite/SQLiteProgram.java @@ -76,7 +76,7 @@ public abstract class SQLiteProgram extends SQLiteClosable { @Override protected void onAllReferencesReleased() { // release the compiled sql statement used by me if it is NOT in cache - if (!myCompiledSqlIsInCache) { + if (!myCompiledSqlIsInCache && compiledSql != null) { compiledSql.releaseSqlStatement(); compiledSql = null; // so that GC doesn't call finalize() on it } @@ -87,7 +87,7 @@ public abstract class SQLiteProgram extends SQLiteClosable { @Override protected void onAllReferencesReleasedFromContainer() { // release the compiled sql statement used by me if it is NOT in cache - if (!myCompiledSqlIsInCache) { + if (!myCompiledSqlIsInCache && compiledSql != null) { compiledSql.releaseSqlStatement(); compiledSql = null; // so that GC doesn't call finalize() on it } |
