From a40ec58fcad262eff8cf7d98c122b5b1da80d095 Mon Sep 17 00:00:00 2001 From: "pengfei.zhou" Date: Tue, 2 Mar 2021 16:43:28 +0800 Subject: [PATCH] feat:stop debugging when devkit is disconnected from server --- .../devkit/src/main/java/pub/doric/devkit/DoricDev.java | 2 ++ doric-iOS/Devkit/Classes/DoricDev.m | 2 ++ 2 files changed, 4 insertions(+) diff --git a/doric-android/devkit/src/main/java/pub/doric/devkit/DoricDev.java b/doric-android/devkit/src/main/java/pub/doric/devkit/DoricDev.java index f180cccd..bbb1726d 100644 --- a/doric-android/devkit/src/main/java/pub/doric/devkit/DoricDev.java +++ b/doric-android/devkit/src/main/java/pub/doric/devkit/DoricDev.java @@ -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() { diff --git a/doric-iOS/Devkit/Classes/DoricDev.m b/doric-iOS/Devkit/Classes/DoricDev.m index dd017e97..4ae6c969 100644 --- a/doric-iOS/Devkit/Classes/DoricDev.m +++ b/doric-iOS/Devkit/Classes/DoricDev.m @@ -132,6 +132,7 @@ - (void)onOpen { - (void)onClose { self.devKitConnected = NO; + [self stopDebugging:YES]; dispatch_async(dispatch_get_main_queue(), ^{ for (id 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 callback in self.callbacks) { [callback onFailure:error];