From ef4852b7ec75f25179028a0e2606d96a58f8297b Mon Sep 17 00:00:00 2001 From: gin0606 Date: Tue, 29 Jul 2014 17:56:03 +0900 Subject: [PATCH] Fix iOS VideoPlayer memory leak. --- cocos/ui/UIVideoPlayerIOS.mm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cocos/ui/UIVideoPlayerIOS.mm b/cocos/ui/UIVideoPlayerIOS.mm index d67d6ed770..517d5798ac 100644 --- a/cocos/ui/UIVideoPlayerIOS.mm +++ b/cocos/ui/UIVideoPlayerIOS.mm @@ -133,11 +133,11 @@ using namespace cocos2d::experimental::ui; } if (videoSource == 1) { - self.moviePlayer = [[MPMoviePlayerController alloc] initWithContentURL:[NSURL URLWithString:@(videoUrl.c_str())]]; + self.moviePlayer = [[[MPMoviePlayerController alloc] initWithContentURL:[NSURL URLWithString:@(videoUrl.c_str())]] autorelease]; self.moviePlayer.movieSourceType = MPMovieSourceTypeStreaming; } else { NSString *path = [UIVideoViewWrapperIos fullPathFromRelativePath:@(videoUrl.c_str())]; - self.moviePlayer = [[MPMoviePlayerController alloc] initWithContentURL:[NSURL fileURLWithPath:path]]; + self.moviePlayer = [[[MPMoviePlayerController alloc] initWithContentURL:[NSURL fileURLWithPath:path]] autorelease]; self.moviePlayer.movieSourceType = MPMovieSourceTypeFile; } self.moviePlayer.allowsAirPlay = false;