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