You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@weex.apache.org by cx...@apache.org on 2018/06/19 09:40:52 UTC

[05/50] [abbrv] incubator-weex git commit: * [iOS] fix history issue : delete rootNode in mainThread

* [iOS] fix history issue : delete rootNode in mainThread


Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/69679b03
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/69679b03
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/69679b03

Branch: refs/heads/release
Commit: 69679b034eccaf1312799e2f8597dda857b91a2f
Parents: 185d393
Author: zhongcang <qh...@gmail.com>
Authored: Tue Jun 5 11:17:48 2018 +0800
Committer: Adam Feng <cx...@gmail.com>
Committed: Thu Jun 7 17:58:56 2018 +0800

----------------------------------------------------------------------
 ios/sdk/WeexSDK/Sources/Manager/WXComponentManager.mm | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/69679b03/ios/sdk/WeexSDK/Sources/Manager/WXComponentManager.mm
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Manager/WXComponentManager.mm b/ios/sdk/WeexSDK/Sources/Manager/WXComponentManager.mm
index 0bda28a..ed3e9f0 100644
--- a/ios/sdk/WeexSDK/Sources/Manager/WXComponentManager.mm
+++ b/ios/sdk/WeexSDK/Sources/Manager/WXComponentManager.mm
@@ -94,9 +94,11 @@ static NSThread *WXComponentThread;
 - (void)dealloc
 {
     if(_rootFlexCSSNode){
-        delete _rootFlexCSSNode;
-        
-       // WeexCore::WXCoreLayoutNode::freeNodeTree(_rootFlexCSSNode);
+        if ([[NSThread currentThread].name isEqualToString:WX_COMPONENT_THREAD_NAME]) {
+            delete _rootFlexCSSNode;
+        }else{
+            [WXComponent recycleNodeOnComponentThread:_rootFlexCSSNode gabRef:@"_root_p"];
+        }
         _rootFlexCSSNode=nullptr;
     }
     [NSMutableArray wx_releaseArray:_fixedComponents];