File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
library/src/main/java/com/readystatesoftware/sqliteasset Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -179,6 +179,7 @@ public synchronized SQLiteDatabase getWritableDatabase() {
179179
180180 // do force upgrade
181181 if (version != 0 && version < mForcedUpgradeVersion ) {
182+ db .close ();
182183 db = createOrOpenDatabase (true );
183184 db .setVersion (mNewVersion );
184185 version = db .getVersion ();
@@ -288,6 +289,7 @@ public synchronized void close() {
288289 mDatabase .close ();
289290 mDatabase = null ;
290291 }
292+ super .close ();
291293 }
292294
293295 @ Override
@@ -391,6 +393,7 @@ private SQLiteDatabase createOrOpenDatabase(boolean force) throws SQLiteAssetExc
391393 // database already exists
392394 if (force ) {
393395 Log .w (TAG , "forcing database upgrade!" );
396+ db .close ();
394397 copyDatabaseFromAssets ();
395398 db = returnDatabase ();
396399 }
@@ -513,4 +516,4 @@ public SQLiteAssetException(String error) {
513516 }
514517 }
515518
516- }
519+ }
You can’t perform that action at this time.
0 commit comments