feat:stop debugging when devkit is disconnected from server

This commit is contained in:
pengfei.zhou 2021-03-02 16:43:28 +08:00 committed by osborn
parent 2e678b1231
commit a40ec58fca
2 changed files with 4 additions and 0 deletions

View File

@ -183,6 +183,7 @@ public class DoricDev {
public void onClose() {
devKitConnected = false;
stopDebugging(true);
uiHandler.post(new Runnable() {
@Override
public void run() {
@ -195,6 +196,7 @@ public class DoricDev {
public void onFailure(final Throwable t) {
devKitConnected = false;
stopDebugging(true);
uiHandler.post(new Runnable() {
@Override
public void run() {

View File

@ -132,6 +132,7 @@ - (void)onOpen {
- (void)onClose {
self.devKitConnected = NO;
[self stopDebugging:YES];
dispatch_async(dispatch_get_main_queue(), ^{
for (id <DoricDevStatusCallback> callback in self.callbacks) {
[callback onClose:self.url];
@ -141,6 +142,7 @@ - (void)onClose {
- (void)onFailure:(NSError *)error {
self.devKitConnected = NO;
[self stopDebugging:YES];
dispatch_async(dispatch_get_main_queue(), ^{
for (id <DoricDevStatusCallback> callback in self.callbacks) {
[callback onFailure:error];