diff --git a/doric-iOS/Pod/Classes/DoricContext.m b/doric-iOS/Pod/Classes/DoricContext.m index 9b1869c1..04914b2a 100644 --- a/doric-iOS/Pod/Classes/DoricContext.m +++ b/doric-iOS/Pod/Classes/DoricContext.m @@ -60,8 +60,9 @@ - (DoricViewNode *)targetViewNode:(NSString *)viewId { } - (void)dealloc { - [self callEntity:DORIC_ENTITY_DESTROY withArgumentsArray:@[]]; [[DoricContextManager instance] destroyContext:self]; + [self callEntity:DORIC_ENTITY_DESTROY withArgumentsArray:@[]]; + [self.driver destroyContext:self.contextId]; } - (DoricAsyncResult *)callEntity:(NSString *)method, ... { diff --git a/doric-iOS/Pod/Classes/DoricContextManager.m b/doric-iOS/Pod/Classes/DoricContextManager.m index 0b4926b9..fdf2d39f 100644 --- a/doric-iOS/Pod/Classes/DoricContextManager.m +++ b/doric-iOS/Pod/Classes/DoricContextManager.m @@ -72,7 +72,6 @@ - (void)destroyContext:(DoricContext *)context { dispatch_sync(self.mapQueue, ^() { [self.doricContextMap removeObjectForKey:contextId]; }); - [context.driver destroyContext:contextId]; } - (NSArray *)aliveContexts {