Skip to content

Commit

Permalink
fix(android): fix leak caused by removing lifecycle listener too early (
Browse files Browse the repository at this point in the history
#3380)

* Fix lifecycle listener being removed too early
  • Loading branch information
BasixKOR authored Nov 23, 2023
1 parent b3744f9 commit 0c0f317
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@

# [6.0.0-beta.1](https://github.com/react-native-video/react-native-video/compare/v6.0.0-beta.0...v6.0.0-beta.1) (WIP)
* **android:** fix leak caused by removing lifecycle listener too early ([#3380](https://github.com/react-native-video/react-native-video/pull/3380))

# [6.0.0-beta.0](https://github.com/react-native-video/react-native-video/compare/v6.0.0-alpha.11...v6.0.0-beta.0) (2023-11-18)

Expand Down Expand Up @@ -56,7 +58,7 @@
- iOS: Fix audio session category when not using the audioOutput prop
- iOS: implement onPlaybackStateChanged callback [#3307](https://github.com/react-native-video/react-native-video/pull/3307)
- iOS: remove false calls at onPlaybackRateChange [#3306](https://github.com/react-native-video/react-native-video/pull/3306)
- iOS: audio does not work with headphones [#3284](https://github.com/react-native-video/react-native-video/pull/3284)
- iOS: audio does not work with headphones [#3284](https://github.com/react-native-video/react-native-video/pull/3284)
- iOS: Resuming video ad after closing the in-app browser on iOS [#3275](https://github.com/react-native-video/react-native-video/pull/3275)
- iOS, Android: expose playback functions to ref [#3245](https://github.com/react-native-video/react-native-video/pull/3245)
- tvOS: fix build: [#3276](https://github.com/react-native-video/react-native-video/pull/3276)
Expand Down Expand Up @@ -387,4 +389,4 @@
- Add cookie support for ExoPlayer [#922](https://github.com/react-native-community/react-native-video/pull/922)
- Remove ExoPlayer onMetadata that wasn't being used [#1040](https://github.com/react-native-community/react-native-video/pull/1040)
- Fix bug where setting the progress interval on iOS didn't work [#800](https://github.com/react-native-community/react-native-video/pull/800)
- Support setting the poster resize mode [#595](https://github.com/react-native-community/react-native-video/pull/595)
- Support setting the poster resize mode [#595](https://github.com/react-native-community/react-native-video/pull/595)
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,7 @@ public void onHostPause() {
@Override
public void onHostDestroy() {
stopPlayback();
themedReactContext.removeLifecycleEventListener(this);
}

public void cleanUpResources() {
Expand Down Expand Up @@ -881,7 +882,6 @@ private void releasePlayer() {
}
adsLoader = null;
progressHandler.removeMessages(SHOW_PROGRESS);
themedReactContext.removeLifecycleEventListener(this);
audioBecomingNoisyReceiver.removeListener();
bandwidthMeter.removeEventListener(this);

Expand Down

0 comments on commit 0c0f317

Please sign in to comment.