You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@weex.apache.org by GitBox <gi...@apache.org> on 2018/09/17 13:25:38 UTC

[GitHub] YorkShen closed pull request #1534: default multiProgress, if failed in multiProgress turn to singleProgr…

YorkShen closed pull request #1534: default multiProgress, if failed in multiProgress turn to singleProgr…
URL: https://github.com/apache/incubator-weex/pull/1534
 
 
   

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/weex_core/Source/android/jsengine/multiprocess/WeexJSConnection.cpp b/weex_core/Source/android/jsengine/multiprocess/WeexJSConnection.cpp
index 187b9b38dc..d2a609bee9 100644
--- a/weex_core/Source/android/jsengine/multiprocess/WeexJSConnection.cpp
+++ b/weex_core/Source/android/jsengine/multiprocess/WeexJSConnection.cpp
@@ -296,8 +296,13 @@ IPCSender *WeexJSConnection::start(IPCHandler *handler, IPCHandler *serverHandle
 }
 
 void WeexJSConnection::end() {
-  m_impl->serverSender.reset();
-  m_impl->futexPageQueue.reset();
+  try {
+    m_impl->serverSender.reset();
+    m_impl->futexPageQueue.reset();
+  } catch (IPCException &e) {
+    //avoid crash
+  }
+    
   if (m_impl->child) {
     int wstatus;
     pid_t child;
diff --git a/weex_core/Source/android/wrap/wx_bridge.cpp b/weex_core/Source/android/wrap/wx_bridge.cpp
index fdb9067398..a2eac74498 100644
--- a/weex_core/Source/android/wrap/wx_bridge.cpp
+++ b/weex_core/Source/android/wrap/wx_bridge.cpp
@@ -268,26 +268,53 @@ static jint InitFramework(JNIEnv* env, jobject object, jstring script,
   // If parse init params error, return false
   if (params_vector.empty()) return false;
   // Set project mode
-  if (isSingleProcess()) {
-    WeexCoreManager::Instance()->set_project_mode(
-        WeexCoreManager::ProjectMode::MULTI_SO);
-  } else {
-    WeexCoreManager::Instance()->set_project_mode(
-        WeexCoreManager::ProjectMode::MULTI_PROCESS);
-  }
-  // Init script bridge
-  if (WeexCoreManager::Instance()->project_mode() ==
-      WeexCoreManager::ProjectMode::MULTI_PROCESS) {
-    WeexCoreManager::Instance()->set_script_bridge(
-        new ScriptBridgeInMultiProcess);
-  } else {
-    WeexCoreManager::Instance()->set_script_bridge(new ScriptBridgeInMultiSo);
-  }
+
+
+  WeexCoreManager::Instance()->set_project_mode(
+          WeexCoreManager::ProjectMode::MULTI_PROCESS);
+
+  WeexCoreManager::Instance()->set_script_bridge(
+          new ScriptBridgeInMultiProcess);
+
   // It means initialization failed when any bridge is not passable
   if (!WeexCoreManager::Instance()->getPlatformBridge()->is_passable() ||
       !WeexCoreManager::Instance()->script_bridge()->is_passable()) {
-    return false;
+
+    if(isSingleProcess()) {
+      WeexCoreManager::Instance()->set_project_mode(
+              WeexCoreManager::ProjectMode::MULTI_SO);
+      WeexCoreManager::Instance()->set_script_bridge(new ScriptBridgeInMultiSo);
+
+      if (!WeexCoreManager::Instance()->getPlatformBridge()->is_passable() ||
+          !WeexCoreManager::Instance()->script_bridge()->is_passable()) {
+        return false;
+      }
+    }
   }
+
+
+//  if (isSingleProcess()) {
+//    WeexCoreManager::Instance()->set_project_mode(
+//        WeexCoreManager::ProjectMode::MULTI_SO);
+//  } else {
+//    WeexCoreManager::Instance()->set_project_mode(
+//        WeexCoreManager::ProjectMode::MULTI_PROCESS);
+//  }
+//  // Init script bridge
+//  if (WeexCoreManager::Instance()->project_mode() ==
+//      WeexCoreManager::ProjectMode::MULTI_PROCESS) {
+//    WeexCoreManager::Instance()->set_script_bridge(
+//        new ScriptBridgeInMultiProcess);
+//  } else {
+//    WeexCoreManager::Instance()->set_script_bridge(new ScriptBridgeInMultiSo);
+//  }
+//  // It means initialization failed when any bridge is not passable
+//  if (!WeexCoreManager::Instance()->getPlatformBridge()->is_passable() ||
+//      !WeexCoreManager::Instance()->script_bridge()->is_passable()) {
+//    return false;
+//  }
+
+
   // for environment
   bridge->core_side()->SetPlatform(
       WXCoreEnvironment::getInstance()->platform());


 

----------------------------------------------------------------
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