Merge pull request #7616 from gin0606/fix_videoPlayer_ios_memory_leak

Fix iOS VideoPlayer memory leak.
This commit is contained in:
minggo 2014-08-05 09:30:52 +08:00
commit 007e42faa0
1 changed files with 2 additions and 2 deletions

View File

@ -132,11 +132,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;