vimeo / VIMVideoPlayer

Deprecated: Please use [PlayerKit]( https://github.com/vimeo/PlayerKit) instead.
MIT License
281 stars 62 forks source link

Do not replaceCurrentItemWithPlayerItem:nil during dealloc #61

Closed richardtop closed 4 years ago

richardtop commented 8 years ago

Ticket

Pull request to address issue decribed in #56

Implementation Summary

I skipped [self.player replaceCurrentItemWithPlayerItem:nil]; during dealloc of the VIMVideoPlayer and replaced it by two lines, which are important: remove observers (not to crash) and remove item itself.

    if (self.item)
    {
        [self removePlayerItemObservers:self.item];

        self.item = nil;
    }

How to Test

Main thread is being blocked less during player dealloc, especially when using multiple players.