You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@weex.apache.org by GitBox <gi...@apache.org> on 2019/03/01 03:35:23 UTC
[GitHub] lixiangsanxun opened a new issue #2176: [iOS] 0.19.0版本 WXComponentManager的unload方法中 _rootComponent = nil没有加锁
lixiangsanxun opened a new issue #2176: [iOS] 0.19.0版本 WXComponentManager的unload方法中 _rootComponent = nil没有加锁
URL: https://github.com/apache/incubator-weex/issues/2176
## 背景
项目使用的是0.19.0的WeexSDK版本,最近在定位一个WXComponentManager在方法rootViewFrameDidChange:内因访问_rootComponent而崩溃的问题。目前怀疑是_rootComponent在componentThread线程创建,在主线程释放引起的
## 疑问
_rootComponent在componentThread线程创建,在主线程释放,_rootComponent = nil这行代码是否需要加锁来保证安全性呢,如果在主线程即将释放,此时componentThread线程通过指针访问_rootComponent内存区域,会不会引起崩溃呢?
## 崩溃栈
WeexSDK Version:0.19.0
Device info:iOS 12.0.1 iPhoneX
0 WeexSDK | -[WXComponentManager rootViewFrameDidChange:] (WXCoreLayout.h:891)
-- | --
1 WeexSDK | -[WXComponentManager rootViewFrameDidChange:] (WXComponentManager.mm:183)
2 WeexSDK | __26-[WXSDKInstance setFrame:]_block_invoke_2 (WXSDKInstance.m:190)
3 WeexSDK | +[WXComponentManager _performBlockOnComponentThread:] (WXComponentManager.mm:158)
4 Foundation | ___NSThreadPerformPerform + 336
5 CoreFoundation | ___CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 24
6 CoreFoundation | ___CFRunLoopDoSource0 + 88
7 CoreFoundation | ___CFRunLoopDoSources0 + 176
8 CoreFoundation | ___CFRunLoopRun + 1040
9 CoreFoundation | CFRunLoopRunSpecific + 436
10 Foundation | -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 300
11 WeexSDK | -[WXComponentManager _runLoopThread] (WXComponentManager.mm:143)
12 Foundation | ___NSThread__start__ + 1040
13 libsystem_pthread.dylib | __pthread_body + 128
14 libsystem_pthread.dylib | _pthread_start + 48
----------------------------------------------------------------
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