Skip to content
This repository has been archived by the owner on Jun 3, 2021. It is now read-only.

Commit

Permalink
* [Android] Fix storage problem due to multiple thread (#2010)
Browse files Browse the repository at this point in the history
  • Loading branch information
lvfen authored and YorkShen committed Jan 10, 2019
1 parent 945e93b commit 44cff24
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -143,20 +143,21 @@ public void run() {

@Override
public void close() {
final ExecutorService needCloseService = mExecutorService;
execute(new Runnable() {
@Override
public void run() {
try {
mDatabaseSupplier.closeDatabase();
if (mExecutorService != null) {
mExecutorService.shutdown();
mExecutorService = null;
if (needCloseService != null) {
needCloseService.shutdown();
}
} catch (Exception e) {
WXLogUtils.e(WXSQLiteOpenHelper.TAG_STORAGE, e.getMessage());
}
}
});
mExecutorService = null;
}

private boolean performSetItem(String key, String value, boolean isPersistent, boolean allowRetryWhenFull) {
Expand Down

0 comments on commit 44cff24

Please sign in to comment.