Note that there are some explanatory texts on larger screens.

plurals
  1. POHuge memory leak after using MPMoviePlayerController
    primarykey
    data
    text
    <p>I've come across this 3MB malloc done by CoreVideo on my iPad app after releasing an MPMoviePlayerController object.</p> <p>I've made sure that the player is stopped before released, so it does actually release memory and deallocs properly. The thing is that instruments keeps showing this malloc that hasn't been released (and is not used directly by me in my code) This is the call that's shown in instruments as responsible caller for the 3.52MB Malloc that's never released.</p> <pre><code>CVPixelBufferBacking::initWithPixelBufferDescription </code></pre> <p>Here's the code where the players are stopped and the array that contains them released</p> <pre><code>- (void)dealloc { ... [self stopAllPlayers]; [_moviePlayerViewControllerArray release]; [super dealloc]; } -(void)stopAllPlayers { for (MPMoviePlayerController *mp in _moviePlayerViewControllerArray) { [mp stop]; } } </code></pre> <p>here's the method that adds the video</p> <pre><code>-(void)addVideo:(NSString*) videoName onRect:(CGRect)rect { ...... MPMoviePlayerController * movieController= [[MPMoviePlayerController alloc]initWithContentURL:(NSURL *)videoURL]; // set frame for player movieController.view.frame = rect; // set auto resizing masks [movieController.view setAutoresizingMask:UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleHeight]; // don't auto play. [movieController setShouldAutoplay:NO]; [pdfView addSubview:movieController.view]; [pdfView bringSubviewToFront: movieController.view]; [_moviePlayerViewControllerArray addObject:movieController]; [movieController release]; } </code></pre> <p>EDIT: added image<img src="https://i.stack.imgur.com/hYL4w.png" alt="instruments zombies on simulator (obviously)">. the beautiful 3MB malloc in all it's glory.</p> <p><img src="https://i.stack.imgur.com/1wzgT.png" alt="This other screenshot is the allocations instruments running on the ipad.e"> as you can see the other chunk of memory is no longer there but I still have a major problem. thanks in advance for your help</p>
    singulars
    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.
    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