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

Commit

Permalink
Mege Release/20190410 into master (#2330)
Browse files Browse the repository at this point in the history
* 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 b6b4b06)
  • Loading branch information
YorkShen authored and jianhan-he committed Apr 17, 2019
1 parent 1213337 commit eff1480
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 5 deletions.
3 changes: 2 additions & 1 deletion ios/sdk/WeexSDK/Sources/Manager/WXBridgeManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -491,8 +491,9 @@ - (void)callBack:(NSString *)instanceId funcId:(NSString *)funcId params:(id)par
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 {
Expand Down
21 changes: 17 additions & 4 deletions weex_core/Source/core/bridge/platform/core_side_in_platform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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;
}
}
Expand Down

0 comments on commit eff1480

Please sign in to comment.