Repository: incubator-weex Updated Branches: refs/heads/0.16-dev e37769951 -> c20e93175
* [ios] try to fix attributedString crash Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/99086f30 Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/99086f30 Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/99086f30 Branch: refs/heads/0.16-dev Commit: 99086f301c9a782ba50df4be9ea3fe22ad070581 Parents: 8b9845e Author: acton393 <zhangxing610...@gmail.com> Authored: Thu Aug 10 14:30:09 2017 +0800 Committer: acton393 <zhangxing610...@gmail.com> Committed: Thu Aug 10 14:30:09 2017 +0800 ---------------------------------------------------------------------- ios/sdk/WeexSDK/Sources/Component/WXTextComponent.m | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/99086f30/ios/sdk/WeexSDK/Sources/Component/WXTextComponent.m ---------------------------------------------------------------------- diff --git a/ios/sdk/WeexSDK/Sources/Component/WXTextComponent.m b/ios/sdk/WeexSDK/Sources/Component/WXTextComponent.m index 066b143..2afca0e 100644 --- a/ios/sdk/WeexSDK/Sources/Component/WXTextComponent.m +++ b/ios/sdk/WeexSDK/Sources/Component/WXTextComponent.m @@ -182,7 +182,6 @@ CGFloat WXTextDefaultLineThroughWidth = 1.2; if (_needsRemoveObserver) { [[NSNotificationCenter defaultCenter] removeObserver:self name:WX_ICONFONT_DOWNLOAD_NOTIFICATION object:nil]; } - _ctAttributedString = nil; pthread_mutex_destroy(&_ctAttributedStringMutex); pthread_mutexattr_destroy(&_propertMutexAttr); } @@ -251,7 +250,11 @@ do {\ - (void)setNeedsRepaint { _textStorage = nil; + + pthread_mutex_lock(&(_ctAttributedStringMutex)); _ctAttributedString = nil; + pthread_mutex_unlock(&(_ctAttributedStringMutex)); + } #pragma mark - Subclass