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
|
* Task invoked by a timer periodically to make sure the location listener is
|
||||||
* still registered.
|
* still registered.
|
||||||
*/
|
*/
|
||||||
private final TimerTask checkLocationListener = new TimerTask() {
|
private TimerTask checkLocationListener = new TimerTask() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
// It's always safe to assume that if isRecording() is true, it implies
|
// 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();
|
showNotification();
|
||||||
prefManager.shutdown();
|
prefManager.shutdown();
|
||||||
prefManager = null;
|
prefManager = null;
|
||||||
|
binder = null;
|
||||||
checkLocationListener.cancel();
|
checkLocationListener.cancel();
|
||||||
|
checkLocationListener = null;
|
||||||
timer.cancel();
|
timer.cancel();
|
||||||
timer.purge();
|
timer.purge();
|
||||||
unregisterLocationListener();
|
unregisterLocationListener();
|
||||||
@@ -898,7 +900,7 @@ public class TrackRecordingService extends Service implements LocationListener {
|
|||||||
/**
|
/**
|
||||||
* The ITrackRecordingService is defined through IDL.
|
* The ITrackRecordingService is defined through IDL.
|
||||||
*/
|
*/
|
||||||
private final ITrackRecordingService.Stub binder =
|
private ITrackRecordingService.Stub binder =
|
||||||
new ITrackRecordingService.Stub() {
|
new ITrackRecordingService.Stub() {
|
||||||
@Override
|
@Override
|
||||||
public boolean isRecording() {
|
public boolean isRecording() {
|
||||||
|
|||||||
Reference in New Issue
Block a user