Player icon indicating copy to clipboard operation
Player copied to clipboard

Crash when removing playerLayer from superLayer

Open otymartin opened this issue 4 years ago • 0 comments

@piemonte

I have a stories like feed going on and for memory purposes, once a "story" is advanced, I clean up the player in the previous VC by setting player.playerView.playerLayer.player = nil which works,.

But most important to free up memory I found is to playerLayer.removeFromSuperlayer()

This works fine if I use my own AVPlayer | AVPlayerLayer instance but removing it from (player.playerView.layer as? AVPlayerLayer)?.removeFromSuperlayer() produces a crash.

Why is that?

otymartin avatar Nov 14 '19 16:11 otymartin