비디오를 재생할 때 악기에서 메모리 누수가 나타나는 이유는 누구에게 말해 줄 수 있습니까? movieURL 및 moviePlayer는 모두 dealloc에서 나중에 릴리스되는 합성 속성이 유지됩니다. 귀하의 도움에 미리 감사드립니다.MPMoviePlayerController에서 메모리 누수가 발생했습니다.
- (void)playMovie:(NSString *)movieString {
NSLog(@"playMovie movieString: %@",movieString);
self.movieURL = [Utilities localMovieURLForFileName:movieString];
if (self.movieURL) {
MPMoviePlayerController *mp = [[MPMoviePlayerController alloc] initWithContentURL:self.movieURL];
[[mp view] setFrame: [self.view bounds]]; // frame must match parent view
[self.containerViewController.view addSubview: [mp view]];
if (mp)
{
//save the movie player object
self.moviePlayer = mp;
[mp release];
[self setUpMoviePlayer];
// Apply the user specified settings to the movie player object
//[self setMoviePlayerUserSettings];
// Play the movie!
[self.moviePlayer play];
}
}
self.movieURL = nil;
}
감사합니다. 속성은 retain입니다. 맞아, 맞지? – intomo
dealloc 메소드에서 해제하는 한, 예 – Macmade