You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@weex.apache.org by GitBox <gi...@apache.org> on 2019/01/10 09:07:42 UTC

[GitHub] YorkShen closed pull request #2010: [Android]fix storage 异步执行导致service执行异常的问题

YorkShen closed pull request #2010: [Android]fix storage 异步执行导致service执行异常的问题
URL: https://github.com/apache/incubator-weex/pull/2010
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/android/sdk/src/main/java/com/taobao/weex/appfram/storage/DefaultWXStorage.java b/android/sdk/src/main/java/com/taobao/weex/appfram/storage/DefaultWXStorage.java
index 0ffc230cfb..cc76ad5c24 100644
--- a/android/sdk/src/main/java/com/taobao/weex/appfram/storage/DefaultWXStorage.java
+++ b/android/sdk/src/main/java/com/taobao/weex/appfram/storage/DefaultWXStorage.java
@@ -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) {


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services