FROM : j o a r
DATE : Sat Jan 18 23:04:44 2003
May I ask why you copy the item created in the first place? Why don't
you simple:
[[NSImage imageNamed:@"Connected"] retain];
...if you want to keep the image created? By doing it the way you wrote
in the first message, you'll immediately loose all references to the
created image - and thus "leaking" it until it gets autoreleased - and
only keep a reference to the copy.
It's not clear from your messages that you have understood the concept
of reference counting and aboutorelease pools? Is that the problem, or
is it really something else?
j o a r
On Saturday, Jan 18, 2003, at 22:32 Europe/Stockholm, Jamie Curmi wrote:
> I should point out, every time this is called, more leaks occur. It
> isn't just the first call of [NSImage imageNamed:@"Connected"] that
> leaks (I realise that gets cached). It appears that every call of
> copy, followed by the release, ends up with more memory leaked.
>
> MallocDebug shows the leak - and it increases with each call.
> Similarly "top" shows the vsize increasing with each call.
_______________________________________________
cocoa-dev mailing list | <email_removed>
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
DATE : Sat Jan 18 23:04:44 2003
May I ask why you copy the item created in the first place? Why don't
you simple:
[[NSImage imageNamed:@"Connected"] retain];
...if you want to keep the image created? By doing it the way you wrote
in the first message, you'll immediately loose all references to the
created image - and thus "leaking" it until it gets autoreleased - and
only keep a reference to the copy.
It's not clear from your messages that you have understood the concept
of reference counting and aboutorelease pools? Is that the problem, or
is it really something else?
j o a r
On Saturday, Jan 18, 2003, at 22:32 Europe/Stockholm, Jamie Curmi wrote:
> I should point out, every time this is called, more leaks occur. It
> isn't just the first call of [NSImage imageNamed:@"Connected"] that
> leaks (I realise that gets cached). It appears that every call of
> copy, followed by the release, ends up with more memory leaked.
>
> MallocDebug shows the leak - and it increases with each call.
> Similarly "top" shows the vsize increasing with each call.
_______________________________________________
cocoa-dev mailing list | <email_removed>
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
| Related mails | Author | Date |
|---|---|---|
| Jamie Curmi | Jan 18, 13:59 | |
| j o a r | Jan 18, 17:50 | |
| Jamie Curmi | Jan 18, 22:32 | |
| j o a r | Jan 18, 23:04 | |
| j o a r | Jan 18, 23:21 | |
| Jamie Curmi | Jan 18, 23:27 | |
| j o a r | Jan 19, 00:48 | |
| Andreas Mayer | Jan 19, 01:23 | |
| j o a r | Jan 19, 01:46 | |
| Jamie Curmi | Jan 19, 02:04 | |
| j o a r | Jan 19, 02:10 | |
| Jamie Curmi | Jan 19, 04:27 |






Cocoa mail archive

