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

View File

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