Re: Why does this leak memory?
Re: Why does this leak memory?
- Subject: Re: Why does this leak memory?
- From: j o a r <email@hidden>
- Date: Sun, 19 Jan 2003 01:46:00 +0100
Just another idea - why don't you keep just one image for this purpose.
When you need to modify the counter you could simply use the old image
and paint over the old numerical value with your background color and
then draw the new updated numbers in place - no need to create a new
copy every time.
j o a r
On Saturday, Jan 18, 2003, at 23:27 Europe/Stockholm, Jamie Curmi wrote:
I'll try and explain what I am trying to do. My application has a
dock icon that is updated to reflect status in the application (it has
a graphical count amongst other things).
What I originally was doing was to just retain the image as you
suggested. However, I then modify that image by adding a count to it
graphically. Then I set the application icon ([NSApp
setApplicationIconImage:icon];).
Trouble is that next time I call [NSImage imageNamed:@"Connected"] I
have the modifications as well, so numbers get drawn on top of
numbers, and that messes up the icon.
So I decided what I really needed to do was make a copy of the
[NSImage imageNamed:@"Connected"]. Then I modify that. I set the
application icon image. And release the copy.
_______________________________________________
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.