Skip to content

Commit

Permalink
Fix database locking issue for setForcedUpgrade()
Browse files Browse the repository at this point in the history
Due to an unclosed database
  • Loading branch information
Kisty committed Jan 14, 2016
1 parent a59e8ab commit 45f2fee
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,8 @@ public synchronized SQLiteDatabase getWritableDatabase() {

// do force upgrade
if (version != 0 && version < mForcedUpgradeVersion) {
//Close the old database
db.close();
db = createOrOpenDatabase(true);
db.setVersion(mNewVersion);
version = db.getVersion();
Expand Down

0 comments on commit 45f2fee

Please sign in to comment.