iOS: optimize hot reload operation which causes render error

This commit is contained in:
pengfei.zhou
2022-08-01 15:30:31 +08:00
committed by osborn
parent 61e537aa98
commit f4fcb981b4
2 changed files with 12 additions and 8 deletions

View File

@@ -41,7 +41,7 @@ - (instancetype)initWithContext:(DoricContext *)context callbackId:(NSString *)c
- (void)resolve:(id)result {
__weak typeof(self) __self = self;
if (self.context == nil) {
if (self.context == nil || self.context.destroyed) {
return;
}
[[self.context.driver invokeDoricMethod:DORIC_BRIDGE_RESOLVE
@@ -58,7 +58,7 @@ - (void)resolve:(id)result {
- (void)reject:(id)result {
__weak typeof(self) __self = self;
if (self.context == nil) {
if (self.context == nil || self.context.destroyed) {
return;
}
[[self.context.driver invokeDoricMethod:DORIC_BRIDGE_REJECT