diff options
author | Martin Fietz <Martin.Fietz@gmail.com> | 2016-01-26 11:47:56 +0100 |
---|---|---|
committer | Martin Fietz <Martin.Fietz@gmail.com> | 2016-01-26 11:47:56 +0100 |
commit | a3fcd5efe16c411268024a2306438db4321b5167 (patch) | |
tree | 2022fce56c7327059836f77c558a1513e2bb4bbb /app | |
parent | bc972210485319444b090e6989cce93439f391e8 (diff) | |
download | AntennaPod-a3fcd5efe16c411268024a2306438db4321b5167.zip |
Prevent memory leaks
Diffstat (limited to 'app')
3 files changed, 20 insertions, 0 deletions
diff --git a/app/src/main/java/de/danoeh/antennapod/activity/AudioplayerActivity.java b/app/src/main/java/de/danoeh/antennapod/activity/AudioplayerActivity.java index 66c3205ee..21c81f9e4 100644 --- a/app/src/main/java/de/danoeh/antennapod/activity/AudioplayerActivity.java +++ b/app/src/main/java/de/danoeh/antennapod/activity/AudioplayerActivity.java @@ -111,6 +111,16 @@ public class AudioplayerActivity extends MediaplayerActivity implements NavDrawe } @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()); } diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/ChaptersFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/ChaptersFragment.java index abc9f3d22..513e2f449 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/ChaptersFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/ChaptersFragment.java @@ -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); diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/CoverFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/CoverFragment.java index a3e9723ea..e1265d2d3 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/CoverFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/CoverFragment.java @@ -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(); } |