add debug driver destroy method
This commit is contained in:
parent
93cb80f6f8
commit
6ed34dbbbf
@ -148,7 +148,7 @@ public class DoricContext {
|
|||||||
doricDebugDriver = new DoricDebugDriver(new IStatusCallback() {
|
doricDebugDriver = new DoricDebugDriver(new IStatusCallback() {
|
||||||
@Override
|
@Override
|
||||||
public void start() {
|
public void start() {
|
||||||
isDebugging=true;
|
isDebugging = true;
|
||||||
callEntity(DoricConstant.DORIC_ENTITY_INIT, initParams);
|
callEntity(DoricConstant.DORIC_ENTITY_INIT, initParams);
|
||||||
callEntity(DoricConstant.DORIC_ENTITY_CREATE);
|
callEntity(DoricConstant.DORIC_ENTITY_CREATE);
|
||||||
}
|
}
|
||||||
@ -156,6 +156,7 @@ public class DoricContext {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void stopDebug() {
|
public void stopDebug() {
|
||||||
|
doricDebugDriver.destroy();
|
||||||
isDebugging = false;
|
isDebugging = false;
|
||||||
callEntity(DoricConstant.DORIC_ENTITY_INIT, initParams);
|
callEntity(DoricConstant.DORIC_ENTITY_INIT, initParams);
|
||||||
callEntity(DoricConstant.DORIC_ENTITY_CREATE);
|
callEntity(DoricConstant.DORIC_ENTITY_CREATE);
|
||||||
|
@ -126,4 +126,9 @@ public class DoricDebugDriver implements IDoricDriver {
|
|||||||
public DoricRegistry getRegistry() {
|
public DoricRegistry getRegistry() {
|
||||||
return doricJSEngine.getRegistry();
|
return doricJSEngine.getRegistry();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void destroy() {
|
||||||
|
doricJSEngine.teardown();
|
||||||
|
mBridgeExecutor.shutdown();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -69,6 +69,7 @@ public class DebugContextPanel extends DialogFragment {
|
|||||||
jsonObject.addProperty("projectHome", BuildConfig.PROJECT_HOME);
|
jsonObject.addProperty("projectHome", BuildConfig.PROJECT_HOME);
|
||||||
jsonObject.addProperty("source", doricContext.getSource().replace(".js", ".ts"));
|
jsonObject.addProperty("source", doricContext.getSource().replace(".js", ".ts"));
|
||||||
Doric.sendDevCommand(IDevKit.Command.DEBUG, jsonObject);
|
Doric.sendDevCommand(IDevKit.Command.DEBUG, jsonObject);
|
||||||
|
dismissAllowingStateLoss();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -170,6 +170,7 @@ public class DoricJSEngine implements Handler.Callback, DoricTimerExtension.Time
|
|||||||
|
|
||||||
public void teardown() {
|
public void teardown() {
|
||||||
mDoricJSE.teardown();
|
mDoricJSE.teardown();
|
||||||
|
mTimerExtension.teardown();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void loadBuiltinJS(String assetName) {
|
private void loadBuiltinJS(String assetName) {
|
||||||
|
@ -69,6 +69,10 @@ public class DoricTimerExtension implements Handler.Callback {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void teardown() {
|
||||||
|
mTimerHandler.removeCallbacksAndMessages(null);
|
||||||
|
}
|
||||||
|
|
||||||
private class TimerInfo {
|
private class TimerInfo {
|
||||||
long timerId;
|
long timerId;
|
||||||
long time;
|
long time;
|
||||||
|
Reference in New Issue
Block a user