Re: NSImage TIFFRepresentation memory leak
Re: NSImage TIFFRepresentation memory leak
- Subject: Re: NSImage TIFFRepresentation memory leak
- From: Hidetomo Katsura <email@hidden>
- Date: Fri, 1 Dec 2006 00:33:59 -0800
FYI, this is a textbook case of an OS leak. you (or at least i) can
easily tell from the backtrace. you are only responsible for
releasing a reference that's returned by a method or function. just
file a bug and move on. if it's a significant leak, you have to come
up with a workaround.
in this case, a reference returned by CGLCreateContext (or
allocate_context. it doesn't matter) is the leak, and it was never
returned to you since -[NSImage TIFFRepresentaion] only returns an
autoreleased NSData object (not a CGLCreateContext). obviously, you
can't directly release a reference returned by CGLCreateContext since
you don't even have access to it.
in short, if you didn't create (allocate, copy, or retain) it, it's
not your leak.
katsura
Here's the backtrace from ObjectAlloc stemming from the line in
question. I'm not sure what it's saying, other than
TIFFRepresentation keeps allocating more and more memory...?
GLEngine-2560
start
_start
main()
NSApplicationMain
-[NSApplication run]
-[NSApplication sendEvent:]
-[NSApplication
nextEventMatchingMask:untilDate:inMode:dequeue:]
_DPSNextEvent
BlockUntilNextEventMatchingListInMode
ReceiveNextEventCommon
RunCurrentEventLoopInMode
CFRunLoopRunSpecific
__CFRunLoopRun
__CFRunLoopDoSources()
__CFRunLoopPerformPerform
__NSFireMainThreadPerform
-[MyController writeImageToFile:] <-- The
method in my program is here
-[NSImage TIFFRepresentation]
-[NSImage
TIFFRepresentationUsingCompression:factor:]
-[NSImage _cacheRepresentation]
-[NSImage _cacheRepresentation:stayFocused:]
-[NSImage drawRepresentation]
-[NSImage drawRepresentation:inRect:]
-[NSCIImageRep drawAtPoint:]
-[NSCIImageRep drawInRect:]
-[CIContext drawImage:inRect:fromRect:]
-[CICGContextImpl render:]
CGContextDrawImage
CGContextDelegateDrawImage
0x9475ccd0
0x9475e538
CGSImageDataLockWithReference
img_data_lock
CGAccessSessionGetBytePointer
provider_get_byte_pointer
provider_ensure_data
fe_image_get_bitmap
fe_image_render_
fe_tree_render_image
fe_tree_render_image_
fe_tree_prepare_image
fe_tree_expand_2
fe_tree_expand_2
fe_tree_expand_2
fe_tree_expand_2
fe_tree_expand_2
fe_tree_expand_2
fe_tree_expand_2
fe_tree_expand_2
fe_context_promote_format
fe_gl_buffer_format_p
fe_accel_context
fe_accel_context_
create_context
fe_cgl_create_account
allocate_context
CGLCreateContext
cglInitializeContext
0x15380b8
0x1538e14
0x153a980
0x153aa44
Roland
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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