Skip to content

Commit 409ea23

Browse files
committed
优化销毁命令进程
1 parent 3f18df5 commit 409ea23

File tree

1 file changed

+9
-0
lines changed
  • AndroidExecLibrary/src/main/java/com/excellence/exec

1 file changed

+9
-0
lines changed

AndroidExecLibrary/src/main/java/com/excellence/exec/Command.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,13 +207,22 @@ private boolean isRunning() {
207207
return mStatus == STATUS_RUNNING;
208208
}
209209

210+
private void killProcess() {
211+
if (mProcess != null) {
212+
// close stream
213+
mProcess.destroy();
214+
}
215+
}
216+
210217
private void cancel() {
211218
mStatus = STATUS_INTERRUPT;
219+
killProcess();
212220
mTaskQueue.remove(this);
213221
}
214222

215223
public void discard() {
216224
mStatus = STATUS_INTERRUPT;
225+
killProcess();
217226
remove(this);
218227
}
219228

0 commit comments

Comments
 (0)