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

[Android]fix storage 异步执行导致service执行异常的问题 #2010

Merged
merged 1 commit into from
Jan 10, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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