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

Commit

Permalink
Merge branch 'master' into feature/ws_record_thread_ipc_info
Browse files Browse the repository at this point in the history
  • Loading branch information
Darin726 authored Aug 14, 2019
2 parents 47650b6 + c72e6b5 commit 3dee67e
Showing 1 changed file with 19 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -867,6 +867,14 @@ public int callRefreshFinish(String instanceId, String callback) {

}

public void restartWeexCoreThread(){
WXLogUtils.e("weex","restartWeexCoreThread");
WXThread oldThread = mJSThread;
mJSThread = new WXThread("WeexJSBridgeThread", this);
mJSHandler = mJSThread.getHandler();
oldThread.quit();
}

public int callReportCrashReloadPage(String instanceId, String crashFile) {
boolean isCrashFileEmpty = TextUtils.isEmpty(crashFile);
try {
Expand Down Expand Up @@ -918,6 +926,17 @@ public int callReportCrashReloadPage(String instanceId, String crashFile) {
if (WXSDKManager.getInstance().getSDKInstance(instanceId) != null) {
boolean reloadThisInstance = shouldReloadCurrentInstance(
WXSDKManager.getInstance().getSDKInstance(instanceId).getBundleUrl());
boolean restartCoreThread = true;
IWXConfigAdapter adapter = WXSDKManager.getInstance().getWxConfigAdapter();
if (null != adapter){
String config = adapter.getConfig("wxapm","restartCoreThread","true");
restartCoreThread = Boolean.valueOf(config);
}
if (restartCoreThread){
WXBridgeManager.getInstance().restartWeexCoreThread();
}
WXSDKManager.getInstance().getSDKInstance(instanceId).getContainerInfo()
.put("restartWeexCoreThread",String.valueOf(restartCoreThread));
new ActionReloadPage(instanceId, reloadThisInstance).executeAction();
}

Expand Down

0 comments on commit 3dee67e

Please sign in to comment.