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() {
|
||||
@Override
|
||||
public void start() {
|
||||
isDebugging=true;
|
||||
isDebugging = true;
|
||||
callEntity(DoricConstant.DORIC_ENTITY_INIT, initParams);
|
||||
callEntity(DoricConstant.DORIC_ENTITY_CREATE);
|
||||
}
|
||||
@ -156,6 +156,7 @@ public class DoricContext {
|
||||
}
|
||||
|
||||
public void stopDebug() {
|
||||
doricDebugDriver.destroy();
|
||||
isDebugging = false;
|
||||
callEntity(DoricConstant.DORIC_ENTITY_INIT, initParams);
|
||||
callEntity(DoricConstant.DORIC_ENTITY_CREATE);
|
||||
|
@ -126,4 +126,9 @@ public class DoricDebugDriver implements IDoricDriver {
|
||||
public DoricRegistry 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("source", doricContext.getSource().replace(".js", ".ts"));
|
||||
Doric.sendDevCommand(IDevKit.Command.DEBUG, jsonObject);
|
||||
dismissAllowingStateLoss();
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -170,6 +170,7 @@ public class DoricJSEngine implements Handler.Callback, DoricTimerExtension.Time
|
||||
|
||||
public void teardown() {
|
||||
mDoricJSE.teardown();
|
||||
mTimerExtension.teardown();
|
||||
}
|
||||
|
||||
private void loadBuiltinJS(String assetName) {
|
||||
|
@ -69,6 +69,10 @@ public class DoricTimerExtension implements Handler.Callback {
|
||||
return true;
|
||||
}
|
||||
|
||||
public void teardown() {
|
||||
mTimerHandler.removeCallbacksAndMessages(null);
|
||||
}
|
||||
|
||||
private class TimerInfo {
|
||||
long timerId;
|
||||
long time;
|
||||
|
Reference in New Issue
Block a user