Prevent memory leaks
This commit is contained in:
parent
bc97221048
commit
a3fcd5efe1
|
@ -110,6 +110,16 @@ public class AudioplayerActivity extends MediaplayerActivity implements NavDrawe
|
||||||
saveCurrentFragment();
|
saveCurrentFragment();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onDestroy() {
|
||||||
|
super.onDestroy();
|
||||||
|
// don't risk creating memory leaks
|
||||||
|
navAdapter = null;
|
||||||
|
drawerToggle = null;
|
||||||
|
mPager = null;
|
||||||
|
mPagerAdapter = null;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void chooseTheme() {
|
protected void chooseTheme() {
|
||||||
setTheme(UserPreferences.getNoTitleTheme());
|
setTheme(UserPreferences.getNoTitleTheme());
|
||||||
|
|
|
@ -55,6 +55,11 @@ public class ChaptersFragment extends ListFragment implements AudioplayerContent
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void onDestroy() {
|
||||||
|
super.onDestroy();
|
||||||
|
adapter = null;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onDataSetChanged(Playable media) {
|
public void onDataSetChanged(Playable media) {
|
||||||
adapter.setMedia(media);
|
adapter.setMedia(media);
|
||||||
|
|
|
@ -98,6 +98,11 @@ public class CoverFragment extends Fragment implements
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onDataSetChanged(Playable media) {
|
public void onDataSetChanged(Playable media) {
|
||||||
|
public void onDestroy() {
|
||||||
|
super.onDestroy();
|
||||||
|
// prevent memory leaks
|
||||||
|
root = null;
|
||||||
|
}
|
||||||
this.media = media;
|
this.media = media;
|
||||||
loadMediaInfo();
|
loadMediaInfo();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue