2

the context is a Quartz Composer plugin, in which I want to create a CGImage out of camera frame. This is the relevant code

id<QCPlugInInputImageSource> inputImage_ = self.inputImage;
CGColorSpaceRef colorSpace = [inputImage_ imageColorSpace];

and later

dataProvider = CGDataProviderCreateWithData(NULL, 
                                            [inputImage_ bufferBaseAddress], 
                                            [inputImage_ bufferPixelsHigh] * [inputImage_ bufferBytesPerRow], 
                                            NULL);
cgImage = CGImageCreate(
                       [inputImage_ bufferPixelsWide], 
                       [inputImage_ bufferPixelsHigh], 8, 
                       (pixelFormat == QCPlugInPixelFormatI8 ? 8 : 32), 
                       [inputImage_ bufferBytesPerRow], colorSpace, 
                       (pixelFormat == QCPlugInPixelFormatI8 ? 0 : 
                       kCGImageAlphaPremultipliedFirst | kCGBitmapByteOrder32Host), 
                       dataProvider, NULL, false, kCGRenderingIntentDefault);
CGDataProviderRelease(dataProvider);
CGImageRelease(cgImage);

If I remove the cgImage create and release I got no leak. The leak is only happening in Preview mode of Quartz Composer (which is not Garbage Collected, which could mean something). Thank you in advance

Hazam
  • 62
  • 4
  • It's an old post but I'm facing the same problem with my first ARC plugin (I used to make my plugins in MRC). Did you find any solution? Thank you. – Benoît Lahoz Jun 09 '16 at 13:54
  • No, I ended up completely ditching Quartz Composer and moved to Processing – Hazam Oct 20 '16 at 13:54

0 Answers0