Note that there are some explanatory texts on larger screens.

plurals
  1. POMPMoviePlayerController not released
    primarykey
    data
    text
    <p>I am running an intro movie in a MPMoviePlayerController and i've got a problem with the allocated memory not being released.<br> When the movie finishes, Instruments shows the memory being released.<br> However when i skip the movie by tapping on it the memory is not released.<br> Here are the important parts of my code:</p> <pre><code>- (void)applicationDidFinishLaunching:(UIApplication *)theApplication { self.application = theApplication; NSString *urlStr = [[NSBundle mainBundle] pathForResource:@"mymovie.mov" ofType:nil]; NSURL *url = [NSURL fileURLWithPath:urlStr]; MPMoviePlayerController *moviePlayer = [[MPMoviePlayerController alloc] initWithContentURL:url]; [window addSubview:moviePlayer.view]; moviePlayer.scalingMode = MPMovieScalingModeAspectFit; moviePlayer.controlStyle = MPMovieControlStyleNone; moviePlayer.view.frame = window.frame; UIView *introFrontView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 320, 480)]; introFrontView.userInteractionEnabled = YES; introFrontView.opaque = NO; introTabRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(introTabFrom:)]; [introFrontView addGestureRecognizer:introTabRecognizer]; [moviePlayer.view addSubview:introFrontView]; [introFrontView release]; [introTabRecognizer release]; self.moviePlayerController = moviePlayer; [moviePlayer release]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(introFinished:) name:MPMoviePlayerPlaybackDidFinishNotification object:self.moviePlayerController]; [self.moviePlayerController play]; } - (void)introTabFrom:(UITapGestureRecognizer*)recognizer{ [[NSNotificationCenter defaultCenter] postNotificationName:MPMoviePlayerPlaybackDidFinishNotification object:self.moviePlayerController]; } - (void) introFinished:(NSNotification*)notification { [[NSNotificationCenter defaultCenter] removeObserver:self name:MPMoviePlayerPlaybackDidFinishNotification object:self.moviePlayerController]; [self.moviePlayerController pause]; [self.moviePlayerController stop]; [self.moviePlayerController release]; ... } </code></pre> <p>Is there anything i forgot?<br> To my understanding i'm posting the correct notification...<br> Any ideas?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload