fix:iOS Runloop cannot exit and other issues

This commit is contained in:
pengfei.zhou
2021-03-04 12:53:42 +08:00
committed by osborn
parent 627f323ae3
commit e78625281f
6 changed files with 20 additions and 8 deletions

View File

@@ -205,9 +205,9 @@ - (void)startDebugging:(NSString *)source {
[self.wsClient sendToDebugger:@"DEBUG_RES" payload:@{
@"contextId": context.contextId
}];
self.debuggable = [[DoricContextDebuggable alloc] initWithWSClient:self.wsClient context:context];
[self.debuggable startDebug];
dispatch_async(dispatch_get_main_queue(), ^{
self.debuggable = [[DoricContextDebuggable alloc] initWithWSClient:self.wsClient context:context];
[self.debuggable startDebug];
for (id <DoricDevStatusCallback> callback in self.callbacks) {
[callback onStartDebugging:context];
}
@@ -224,9 +224,9 @@ - (void)stopDebugging:(BOOL)resume {
[self.wsClient sendToDebugger:@"DEBUG_STOP" payload:@{
@"msg": @"Stop debugging"
}];
[self.debuggable stopDebug:resume];
self.debuggable = nil;
dispatch_async(dispatch_get_main_queue(), ^{
[self.debuggable stopDebug:resume];
self.debuggable = nil;
for (id <DoricDevStatusCallback> callback in self.callbacks) {
[callback onStopDebugging];
}