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/09/19 05:40:04 UTC

[GitHub] [incubator-weex] jqoo opened a new issue #2922: [iOS] viewdisappear后调用组件的方法容易crash

jqoo opened a new issue #2922: [iOS] viewdisappear后调用组件的方法容易crash
URL: https://github.com/apache/incubator-weex/issues/2922
 
 
   `
   - (SEL)_methodWithComponetName:(NSString *)name withMethod:(NSString *)method isSync:(BOOL *)isSync
   {
       WXAssert(name && method, @"Fail to find selector with module name and method, please check if the parameters are correct !");
       //...
   }
   `
   闪退在了这里,原因是在页面pop时,发出了disappear,然后销毁了页面里的实例,但页面里disappear事件的回调方法里,调用组件的方法时,self.instance依然是非空,根据ref找不到组件:
   `
   - (void)invoke
   {
       WXPerformBlockOnComponentThread(^{
           WXComponent *component = [self.instance componentForRef:_componentRef];
           if (!component) {
               WXLogError(@"component not found for ref:%@, type:%@", _componentRef, _componentName);
           }
       //...
   }
   `
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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