Skip to content

Commit afb1991

Browse files
committed
temporal player memory leaking fix 2
1 parent 5fed47f commit afb1991

File tree

2 files changed

+16
-14
lines changed

2 files changed

+16
-14
lines changed

smarttubetv/src/main/java/com/liskovsoft/smartyoutubetv2/tv/ui/common/LeanbackActivity.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -129,11 +129,7 @@ public void finish() {
129129
public void finishReally() {
130130
// Mandatory line. Fix un-proper view order (especially for playback view).
131131
getViewManager().startParentView(this);
132-
// NOTE: temporal player memory leaking fix (Activities num grow with every player start)!
133-
// The command to check: adb shell dumpsys meminfo org.smarttube.stable
134-
if (!(this instanceof PlaybackActivity)) {
135-
super.finishReally();
136-
}
132+
super.finishReally();
137133
}
138134

139135
private void finishTheApp() {

smarttubetv/src/main/java/com/liskovsoft/smartyoutubetv2/tv/ui/playback/PlaybackActivity.java

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -181,15 +181,21 @@ public void finish() {
181181
getViewManager().blockTop(this);
182182
getViewManager().startParentView(this);
183183
} else {
184-
if (getPlayerTweaksData().isKeepFinishedActivityEnabled()) {
185-
//moveTaskToBack(true); // Don't do this or you'll have problems when player overlaps other apps (e.g. casting)
186-
getViewManager().startParentView(this);
187-
188-
// Player with TextureView keeps running in background because onStop() fired with huge delay (~5sec).
189-
mPlaybackFragment.maybeReleasePlayer();
190-
} else {
191-
super.finish();
192-
}
184+
// NOTE: temporal player memory leaking fix (Activities num grow with every player start)!
185+
// The command to check: adb shell dumpsys meminfo org.smarttube.stable
186+
getViewManager().startParentView(this);
187+
// Player with TextureView keeps running in background because onStop() fired with huge delay (~5sec).
188+
mPlaybackFragment.maybeReleasePlayer();
189+
190+
//if (getPlayerTweaksData().isKeepFinishedActivityEnabled()) {
191+
// //moveTaskToBack(true); // Don't do this or you'll have problems when player overlaps other apps (e.g. casting)
192+
// getViewManager().startParentView(this);
193+
//
194+
// // Player with TextureView keeps running in background because onStop() fired with huge delay (~5sec).
195+
// mPlaybackFragment.maybeReleasePlayer();
196+
//} else {
197+
// super.finish();
198+
//}
193199
}
194200
}
195201

0 commit comments

Comments
 (0)