You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@weex.apache.org by ac...@apache.org on 2018/04/11 07:46:10 UTC

incubator-weex git commit: * [iOS] try to fix the crash of remove from superview

Repository: incubator-weex
Updated Branches:
  refs/heads/master 060c7b454 -> 01f79b35b


* [iOS] try to fix the crash of remove from superview


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

Branch: refs/heads/master
Commit: 01f79b35b03c81607082933ed7c6442ab8100f2c
Parents: 060c7b4
Author: acton393 <zh...@gmail.com>
Authored: Wed Apr 11 15:45:56 2018 +0800
Committer: acton393 <zh...@gmail.com>
Committed: Wed Apr 11 15:45:56 2018 +0800

----------------------------------------------------------------------
 ios/sdk/WeexSDK/Sources/View/WXComponent+ViewManagement.m | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/01f79b35/ios/sdk/WeexSDK/Sources/View/WXComponent+ViewManagement.m
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/View/WXComponent+ViewManagement.m b/ios/sdk/WeexSDK/Sources/View/WXComponent+ViewManagement.m
index e066a14..66d6ad5 100644
--- a/ios/sdk/WeexSDK/Sources/View/WXComponent+ViewManagement.m
+++ b/ios/sdk/WeexSDK/Sources/View/WXComponent+ViewManagement.m
@@ -329,7 +329,10 @@ do {\
         [subcomponents _unloadViewWithReusing:isReusing];
     }
     
-    [_view removeFromSuperview];
+    if ([_view superview]) {
+        [_view removeFromSuperview];
+    }
+    
     if (self->_isTemplate && self.attributes[@"@templateId"]) {
         [[WXSDKManager bridgeMgr] callComponentHook:self.weexInstance.instanceId componentId:self.attributes[@"@templateId"] type:@"lifecycle" hook:@"detach" args:nil competion:nil];
     }