You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@weex.apache.org by ji...@apache.org on 2019/04/17 06:34:52 UTC

[incubator-weex] branch master updated: Mege Release/20190410 into master (#2330)

This is an automated email from the ASF dual-hosted git repository.

jianhan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-weex.git


The following commit(s) were added to refs/heads/master by this push:
     new eff1480  Mege Release/20190410 into master (#2330)
eff1480 is described below

commit eff1480a2e36c15578fcd5dc243986c0887512f4
Author: YorkShen <sh...@gmail.com>
AuthorDate: Wed Apr 17 14:34:47 2019 +0800

    Mege Release/20190410 into master (#2330)
    
    * Avoid null pointer if data_render_handler() not exists.
    
    * [iOS] Fix background is set to transparent when no border.
    
    * [Weex] bugfix ios callback crash
    
    * * [Android] Remove armABIOnly flag, which will cause 32 bits so and 64 bits cross link problem.
    
    (cherry picked from commit b6b4b06d5cc5b336fd1f4275a107c91202d64325)
---
 ios/sdk/WeexSDK/Sources/Manager/WXBridgeManager.m   |  3 ++-
 .../core/bridge/platform/core_side_in_platform.cpp  | 21 +++++++++++++++++----
 2 files changed, 19 insertions(+), 5 deletions(-)

diff --git a/ios/sdk/WeexSDK/Sources/Manager/WXBridgeManager.m b/ios/sdk/WeexSDK/Sources/Manager/WXBridgeManager.m
index 1f531b1..2954a69 100644
--- a/ios/sdk/WeexSDK/Sources/Manager/WXBridgeManager.m
+++ b/ios/sdk/WeexSDK/Sources/Manager/WXBridgeManager.m
@@ -491,8 +491,9 @@ void WXPerformBlockSyncOnBridgeThread(void (^block) (void))
     if (instance.wlasmRender) {
         id<WXDataRenderHandler> dataRenderHandler = [WXHandlerFactory handlerForProtocol:@protocol(WXDataRenderHandler)];
         if (dataRenderHandler) {
+            id strongArgs = params ? [params copy]:@"\"{}\"";
             WXPerformBlockOnComponentThread(^{
-                [dataRenderHandler invokeCallBack:instanceId function:funcId args:params ? [params copy]:@"\"{}\"" keepAlive:keepAlive];
+                [dataRenderHandler invokeCallBack:instanceId function:funcId args:strongArgs keepAlive:keepAlive];
             });
         }
         else {
diff --git a/weex_core/Source/core/bridge/platform/core_side_in_platform.cpp b/weex_core/Source/core/bridge/platform/core_side_in_platform.cpp
index 833b3a0..674409c 100644
--- a/weex_core/Source/core/bridge/platform/core_side_in_platform.cpp
+++ b/weex_core/Source/core/bridge/platform/core_side_in_platform.cpp
@@ -320,8 +320,8 @@ int CoreSideInPlatform::RefreshInstance(
 
   std::string init_data = weex::base::to_utf8(params[1]->value.string->content,
                                               params[1]->value.string->length);
-
-  if (EagleBridge::GetInstance()->data_render_handler()->RefreshPage(instanceId, init_data)) {
+  auto handler = EagleBridge::GetInstance()->data_render_handler();
+  if (handler && handler->RefreshPage(instanceId, init_data)) {
     return true;
   }
   return ExecJS(instanceId, nameSpace, func, params);
@@ -443,7 +443,13 @@ int CoreSideInPlatform::CreateInstance(const char *instanceId, const char *func,
                                extendsApi.c_str(),params);
         };
     if (strcmp(render_strategy, "DATA_RENDER") == 0) {
-        EagleBridge::GetInstance()->data_render_handler()->CreatePage(script, instanceId, render_strategy, initData, exec_js);
+        auto handler = EagleBridge::GetInstance()->data_render_handler();
+        if(handler){
+          handler->CreatePage(script, instanceId, render_strategy, initData, exec_js);
+        }
+        else{
+          LOGE("DATA_RENDER mode should not be used if there is no data_render_handler");
+        }
 
       return true;
     } else if (strcmp(render_strategy, "DATA_RENDER_BINARY") == 0) {
@@ -475,7 +481,14 @@ int CoreSideInPlatform::CreateInstance(const char *instanceId, const char *func,
         };
         option = json11::Json(new_option).dump();
       }
-      EagleBridge::GetInstance()->data_render_handler()->CreatePage(script, static_cast<size_t>(script_length), instanceId, option, env_str, initData, exec_js);
+      
+      auto handler = EagleBridge::GetInstance()->data_render_handler();
+      if(handler){
+        handler->CreatePage(script, static_cast<size_t>(script_length), instanceId, option, env_str, initData, exec_js);
+      }
+      else{
+        LOGE("DATA_RENDER_BINARY mode should not be used if there is no data_render_handler"); 
+      }
       return true;
     }
   }