fix iOS crash when call Destory

This commit is contained in:
pengfei.zhou
2020-05-06 17:34:48 +08:00
committed by osborn
parent c9c99cce06
commit 7828b24cd5
12 changed files with 43 additions and 2 deletions

View File

@@ -35,7 +35,9 @@ - (void)render:(NSDictionary *)argument withPromise:(DoricPromise *)promise {
__weak typeof(self) _self = self;
dispatch_async(dispatch_get_main_queue(), ^{
__strong typeof(_self) self = _self;
if (self.doricContext == nil) {
return;
}
NSString *viewId = argument[@"id"];
if (self.doricContext.rootNode.viewId == nil && [@"Root" isEqualToString:argument[@"type"]]) {
@@ -53,6 +55,9 @@ - (void)render:(NSDictionary *)argument withPromise:(DoricPromise *)promise {
- (void)command:(NSDictionary *)argument withPromise:(DoricPromise *)promise {
dispatch_async(dispatch_get_main_queue(), ^{
if (self.doricContext == nil) {
return;
}
NSArray *viewIds = argument[@"viewIds"];
id args = argument[@"args"];
NSString *name = argument[@"name"];