You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@weex.apache.org by mo...@apache.org on 2019/09/02 03:09:33 UTC

[incubator-weex] branch fix-animation-crash2 created (now 8ce1318)

This is an automated email from the ASF dual-hosted git repository.

moshen pushed a change to branch fix-animation-crash2
in repository https://gitbox.apache.org/repos/asf/incubator-weex.git.


      at 8ce1318  Fix potential crash of animation.

This branch includes the following new commits:

     new 8ce1318  Fix potential crash of animation.

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[incubator-weex] 01/01: Fix potential crash of animation.

Posted by mo...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

moshen pushed a commit to branch fix-animation-crash2
in repository https://gitbox.apache.org/repos/asf/incubator-weex.git

commit 8ce131838c7f54d029c398537e410bfb3e3e551f
Author: qianyuan.wqy <qi...@taobao.com>
AuthorDate: Mon Sep 2 11:09:15 2019 +0800

    Fix potential crash of animation.
---
 ios/sdk/WeexSDK/Sources/Manager/WXComponentManager.mm | 7 +++++--
 ios/sdk/WeexSDK/Sources/Module/WXTransition.mm        | 3 ++-
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/ios/sdk/WeexSDK/Sources/Manager/WXComponentManager.mm b/ios/sdk/WeexSDK/Sources/Manager/WXComponentManager.mm
index cd1aa31..f4b29a8 100644
--- a/ios/sdk/WeexSDK/Sources/Manager/WXComponentManager.mm
+++ b/ios/sdk/WeexSDK/Sources/Manager/WXComponentManager.mm
@@ -694,8 +694,9 @@ static NSThread *WXComponentThread;
     [component _updateStylesOnMainThread:normalStyles resetStyles:resetStyles];
     [component readyToRender];
     
+    NSDictionary* dupStyles = [NSDictionary dictionaryWithDictionary:normalStyles];
     WXPerformBlockOnComponentThread(^{
-        [component _updateStylesOnComponentThread:normalStyles resetStyles:resetStyles isUpdateStyles:isUpdateStyles];
+        [component _updateStylesOnComponentThread:dupStyles resetStyles:resetStyles isUpdateStyles:isUpdateStyles];
     });
 }
 
@@ -711,8 +712,10 @@ static NSThread *WXComponentThread;
     NSMutableArray *resetStyles = [NSMutableArray new];
     [self filterStyles:styles normalStyles:normalStyles resetStyles:resetStyles];
     [component _updateStylesOnComponentThread:normalStyles resetStyles:resetStyles isUpdateStyles:isUpdateStyles];
+    
+    NSDictionary* dupStyles = [NSDictionary dictionaryWithDictionary:normalStyles];
     [self _addUITask:^{
-        [component _updateStylesOnMainThread:normalStyles resetStyles:resetStyles];
+        [component _updateStylesOnMainThread:dupStyles resetStyles:resetStyles];
         [component readyToRender];
     }];
 }
diff --git a/ios/sdk/WeexSDK/Sources/Module/WXTransition.mm b/ios/sdk/WeexSDK/Sources/Module/WXTransition.mm
index 15a9e11..8bb616d 100644
--- a/ios/sdk/WeexSDK/Sources/Module/WXTransition.mm
+++ b/ios/sdk/WeexSDK/Sources/Module/WXTransition.mm
@@ -170,8 +170,9 @@
     }
     [targetComponent _updateCSSNodeStyles:styles];
     [targetComponent _resetCSSNodeStyles:resetStyles];
+    NSDictionary* dupStyles = [NSDictionary dictionaryWithDictionary:styles];
     WXPerformBlockOnMainThread(^{
-        [targetComponent _updateViewStyles:styles];
+        [targetComponent _updateViewStyles:dupStyles];
     });
 }