On Jul 27, 2009, at 2:44 PM, David Blanton wrote:

context = CGBitmapContextCreate (bitmap.m_array, bitmap.m_pixelsx, bitmap.m_pixelsy, 8, bitmap.m_pixelsx * 4, colorSpace, kCGImageAlphaNoneSkipFirst|kCGBitmapByteOrder32Host);
        CGImageRelease(_myDocumentView->_cgImageRef);
        _myDocumentView->_cgImageRef =  CGBitmapContextCreateImage (context);
        CGImageRetain(_myDocumentView->_cgImageRef); 
        CGContextRelease(context);
        CGColorSpaceRelease(colorSpace);


This is also over-retaining the CGImage. However you may want to consider creating a CGImage directly instead of going through a bitmap context, as this gives you more flexibility in what types of image data you can represent, as well as avoiding a trip through the kernel to mark the memory for the bitmap context as copy-on-write.
--
David Duncan
Apple DTS Animation and Printing

_______________________________________________

Cocoa-dev mailing list ([email protected])

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to