forked from upstream-mirrors/OpenTracks
Nullify bineder/checkListener on destroy.
This commit is contained in:
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user