Nullify bineder/checkListener on destroy.

This commit is contained in:
Bartlomiej Niechwiej
2010-11-21 20:55:44 -08:00
parent 224fe0069b
commit 223721cca8
@@ -130,7 +130,7 @@ public class TrackRecordingService extends Service implements LocationListener {
* Task invoked by a timer periodically to make sure the location listener is
* still registered.
*/
private final TimerTask checkLocationListener = new TimerTask() {
private TimerTask checkLocationListener = new TimerTask() {
@Override
public void run() {
// It's always safe to assume that if isRecording() is true, it implies
@@ -710,7 +710,9 @@ public class TrackRecordingService extends Service implements LocationListener {
showNotification();
prefManager.shutdown();
prefManager = null;
binder = null;
checkLocationListener.cancel();
checkLocationListener = null;
timer.cancel();
timer.purge();
unregisterLocationListener();
@@ -898,7 +900,7 @@ public class TrackRecordingService extends Service implements LocationListener {
/**
* The ITrackRecordingService is defined through IDL.
*/
private final ITrackRecordingService.Stub binder =
private ITrackRecordingService.Stub binder =
new ITrackRecordingService.Stub() {
@Override
public boolean isRecording() {