• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Debugging "CGImageCreate: invalid image provider: NULL"?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: Debugging "CGImageCreate: invalid image provider: NULL"?
      • From: David Duncan <email@hidden>
  • Prev by Date: Re: How can i change a app position and size?
  • Next by Date: Re: Debugging "CGImageCreate: invalid image provider: NULL"?
  • Previous by thread: Re: How can i change a app position and size?
  • Next by thread: Re: Debugging "CGImageCreate: invalid image provider: NULL"?
  • Index(es):
    • Date
    • Thread