Re: Debugging "CGImageCreate: invalid image provider: NULL"?
Re: Debugging "CGImageCreate: invalid image provider: NULL"?
- Subject: Re: Debugging "CGImageCreate: invalid image provider: NULL"?
- From: Izak van Langevelde <email@hidden>
- Date: Tue, 02 Aug 2011 17:52:06 -0400
Just noticed that using the CGDataProviderRef with callback for data release yields a memory leak:
CGDataProviderRef provider = CGDataProviderCreateWithData(NULL, buffer, len, imageDataRelease);
CGColorSpaceRef space = CGColorSpaceCreateDeviceRGB();
cgImageRef = CGImageCreate(width, // width
height, // height
8, // bitsPerComponent
32, // bitsPerPixel
width*4, // bytesPerRow
space, // colorspace
kCGBitmapByteOrderDefault, // bitmapInfo
provider, // CGDataProvider
NULL, // decode array
NO, // shouldInterpolate
kCGRenderingIntentDefault); // intent
CGDataProviderRelease(provider);
CGColorSpaceRelease(space);
The imageDataRelease method is called after the image is released, with the expected length of 240K (I expect this is called when the provider is freed).
However, Instruments shows a leaked Malloc of 236K with as responsible Caller CGDataProviderCopyData, which makes no sense to me.
Any clues about what is copied here?
---
Grinnikend door het leven...
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden