Search code examples
objective-ccocoamemory-managementqtkit

QTKitServer remaining in Activity Monitor


I have a simple block of code in which I read a movie's size to get the width.

BOOL isHD;
if ([[NSFileManager defaultManager] fileExistsAtPath: filePath]) {
    QTMovie *movie = [QTMovie movieWithFile: filePath error: nil];
    NSValue *movieSize = [movie attributeForKey:QTMovieNaturalSizeAttribute];
    int width = [movieSize sizeValue].width;
    if (width > 1200)
        isHD = YES;
}

My problem is that after this code is read I have a "QTKitServer-(PID)" process left in Activity Monitor that doesn't go away until I quit my app. I thought "movie" would auto release... What am I doing wrong here?


Solution

  • Don't worry about it. This process is an implementation detail of QuickTime X and so it's not your responsibility to clean it up. Your code is correct.

    QuickTime assumes that you will need the services of this process again and keeps it around. It's probably much less expensive to keep this process around doing nothing instead of starting a new one for each request.