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