views:

107

answers:

0

I am using an MPMoviePlayerController to play my movies one after another. I release the controller after the play back finishes, but I still see some residual memory in the object allocations instrument...any ideas on this behavior. I am expecting that after the movie finishes and the controller is released, shouldn't the object allocations fall back to the original position?

This is how I instantiate the controller..

 //Initialize a MPMoviePlayerController object with the movie.
 moviePlayer = [[MPMoviePlayerController alloc] initWithContentURL:url];
  //Set the scaling mode to fill the screen with the movie.
 moviePlayer.scalingMode = MPMovieScalingModeAspectFill; 

 //Add an observer so we can be told when the movie has finished playing.
  [[NSNotificationCenter defaultCenter] addObserver:self selector: @selector(moviePlayBackDidFinish:) name:MPMoviePlayerPlaybackDidFinishNotification object:moviePlayer];      
 [moviePlayer play];

After the playback finishes...I release the controller like this....and it is getting release perfectly...but still there is some residual memory...

//Only from 3.0 or up

moviePlayer.initialPlaybackTime = -1.0;
[moviePlayer stop];
[moviePlayer release];
moviePlayer = nil;

Don't worry about the NSString leak, it has been fixed..even after that I see that MPMoviePlayerController leaves some residual memory allocations