More on releasing NSImages
More on releasing NSImages
- Subject: More on releasing NSImages
- From: Simone Manganelli <email@hidden>
- Date: Sat, 1 Mar 2003 12:57:21 -0800
I had a question in a previous e-mail asking if something special
needed to be done with NSImages before releasing them in order to not
have a memory leak. I've figured out that the memory leak comes in
during these lines of code, because if I comment them out the leak
isn't there:
NSImage *theNewDockImage = [[NSImage alloc]
initByReferencingFile:pathToIcon];
[theNewDockImage lockFocus];
[theNewImage drawInRect:NSMakeRect(0,0,128,128)
fromRect:NSMakeRect(0,0,128,128) operation:NSCompositeSourceOver
fraction:0.5];
[theNewDockImage unlockFocus];
[NSApp setApplicationIconImage:theNewDockImage];
I can't figure out what I'm doing wrong, though. Any suggestions?
-- Simone Manganelli
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.