fix(android): fix leak caused by removing lifecycle listener too early (#3380)
* Fix lifecycle listener being removed too early
This commit is contained in:
		@@ -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);
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user