In MyTracks onDestroy, set trackDataHub to null to save memory

This commit is contained in:
Jimmy Shih
2011-09-22 12:22:23 -07:00
parent 43a1ec60ce
commit 7bd3128e8f
2 changed files with 3 additions and 5 deletions
@@ -249,7 +249,7 @@ public class MyTracks extends TabActivity implements OnTouchListener {
protected void onDestroy() { protected void onDestroy() {
Log.d(TAG, "MyTracks.onDestroy"); Log.d(TAG, "MyTracks.onDestroy");
serviceConnection.unbind(); serviceConnection.unbind();
((MyTracksApplication) getApplication()).clearTrackDataHub();
super.onDestroy(); super.onDestroy();
} }
@@ -26,9 +26,7 @@ public class MyTracksApplication extends Application {
return trackDataHub; return trackDataHub;
} }
@Override public void clearTrackDataHub() {
public void onTerminate() {
trackDataHub = null; trackDataHub = null;
super.onTerminate(); }
}
} }