mirror of
https://github.com/processing/processing4.git
synced 2026-06-16 04:26:26 +02:00
Ensure destruction of logcat process
This commit is contained in:
@@ -166,14 +166,18 @@ class AndroidDevice implements AndroidDeviceProperties {
|
||||
void initialize() throws IOException, InterruptedException {
|
||||
adb("logcat", "-c");
|
||||
logcat = Runtime.getRuntime().exec(generateAdbCommand("logcat"));
|
||||
ProcessRegistry.watch(logcat);
|
||||
new StreamPump(logcat.getInputStream()).addTarget(new LogLineProcessor())
|
||||
.start();
|
||||
new StreamPump(logcat.getErrorStream()).addTarget(System.err).start();
|
||||
System.err.println("Receiving log entries from " + id);
|
||||
}
|
||||
|
||||
void shutdown() {
|
||||
System.err.println(id + " is shutting down.");
|
||||
if (logcat != null) {
|
||||
logcat.destroy();
|
||||
ProcessRegistry.unwatch(logcat);
|
||||
}
|
||||
env.deviceRemoved(this);
|
||||
listeners.clear();
|
||||
|
||||
Reference in New Issue
Block a user