Prevent leaking ServiceConnection when process/threads killed

Change-Id: Id5d85fbdd0d044a59cc61748432e3f714264bcd5
This commit is contained in:
Marc Blank 2011-08-03 15:40:16 -07:00
parent 4418596f9b
commit 8ba8c1648c
1 changed files with 5 additions and 2 deletions

View File

@ -76,7 +76,11 @@ public abstract class ServiceProxy {
// Run our task on a new thread // Run our task on a new thread
new Thread(new Runnable() { new Thread(new Runnable() {
public void run() { public void run() {
runTask(); try {
runTask();
} finally {
endTask();
}
}}).start(); }}).start();
} }
@ -134,7 +138,6 @@ public abstract class ServiceProxy {
thread.join(); thread.join();
} catch (InterruptedException e) { } catch (InterruptedException e) {
} }
endTask();
} }
public boolean setTask(ProxyTask task, String name) { public boolean setTask(ProxyTask task, String name) {