From d9ddb6e75a99954e2003359f42581d75efb33d71 Mon Sep 17 00:00:00 2001 From: Brent Vatne Date: Tue, 7 Apr 2015 10:41:34 -0700 Subject: [PATCH] Clean up better after ourselves --- RCTVideo.m | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/RCTVideo.m b/RCTVideo.m index 175ae2f5..f4df2bf1 100644 --- a/RCTVideo.m +++ b/RCTVideo.m @@ -140,9 +140,14 @@ _playerLayer.frame = self.bounds; } -- (void)dealloc +- (void)removeFromSuperview { + [_player pause]; [_progressUpdateTimer invalidate]; + [_playerLayer removeFromSuperlayer]; + _player = nil; + _prevProgressUpdateTime = nil; + _eventDispatcher = nil; [[NSNotificationCenter defaultCenter] removeObserver:self]; }