• 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
Leaks in NSImage's drawInRect:fromRect:operation:fraction:
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Leaks in NSImage's drawInRect:fromRect:operation:fraction:


  • Subject: Leaks in NSImage's drawInRect:fromRect:operation:fraction:
  • From: Ricky Sharp <email@hidden>
  • Date: Wed, 5 Apr 2006 18:26:44 -0500

As my app nears alpha, I'm now using MallocDebug to ensure it's free of leaks. Only one type of leak remains which has me puzzled.

Each individual leak is always for 100 bytes and it seems to only occur sometimes when I call drawInRect:fromRect:operation:fraction: against an instance of NSImage.

In _all_ cases, my image data comes from vector-based PDFs (created in Adobe Illustrator). But since my app uses hundreds of images, I would have expected to see hundreds of leaks. But I do not. This leads me to think that certain PDFs are exercising different code under the covers. It may be perhaps all those PDFs that use drop- shadows; not all my images use those.

Anyhow, if I comment out those calls to drawInRect:, no leaks occur. So that makes me further believe this may be an Apple bug.

Here's the "stack trace" from Malloc Debug:

- [IIValueFieldCell createCachedImageWithFrame_II:inView:]  <-- my code
- [NSImage drawInRect:fromRect:operation:fraction:]
- [NSImage _cacheRepresentation:]
- [NSImage _cacheRepresentation:stayFocused:]
- [NSImage _drawRepresentation:]
- [NSImage _drawRepresentation:inRect:]
- [NSImage drawAtPoint:]
- [NSPDFImageRep draw]
- CGContextDrawPDFDocument
- CGContextDrawPDFPage
- CGPDFDrawingContextDraw
- CGPDFScannerScan
- execute_stream
- read_objects
- handle_xname
- op_gs         <-- "graphics state operation" ???
- set_soft_mask  <--- something to do with shadows???
- CGPDFDrawingContextCreateSoftMaskForSoftMask
- CGImageCreate
- _CFRuntimeCreateInstance
- CFAllocatorAllocate
- MDNXZoneMalloc (100 bytes leaked)


As this is getting into CG APIs and really low-level PDF stuff, I'm also going to post this to quartz-dev.



___________________________________________________________ Ricky A. Sharp mailto:email@hidden Instant Interactive(tm) http://www.instantinteractive.com

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Leaks in NSImage's drawInRect:fromRect:operation:fraction:
      • From: Ricky Sharp <email@hidden>
  • Prev by Date: Should I use Sync Services?
  • Next by Date: Re: Should I use Sync Services?
  • Previous by thread: Re: Should I use Sync Services?
  • Next by thread: Re: Leaks in NSImage's drawInRect:fromRect:operation:fraction:
  • Index(es):
    • Date
    • Thread