fix(android): fix leak caused by removing lifecycle listener too early (#3380)

* Fix lifecycle listener being removed too early
This commit is contained in:
Sung Jeon
2023-11-24 07:23:44 +09:00
committed by GitHub
parent b3744f9b9f
commit 0c0f3174cb
2 changed files with 5 additions and 3 deletions

View File

@@ -349,6 +349,7 @@ public class ReactExoplayerView extends FrameLayout implements
@Override
public void onHostDestroy() {
stopPlayback();
themedReactContext.removeLifecycleEventListener(this);
}
public void cleanUpResources() {
@@ -881,7 +882,6 @@ public class ReactExoplayerView extends FrameLayout implements
}
adsLoader = null;
progressHandler.removeMessages(SHOW_PROGRESS);
themedReactContext.removeLifecycleEventListener(this);
audioBecomingNoisyReceiver.removeListener();
bandwidthMeter.removeEventListener(this);