FROM : Brent Gulanowski
DATE : Thu Oct 03 21:46:59 2002
On Thursday, October 3, 2002, at 09:03 AM, Vladimir Pilipyuk wrote:
>> NSButtonCell *protoCell;
>>
>> protoCell=[[NSButtonCell alloc] init];
>> [protoCell setButtonType:NSSwitchButton];
>> [protoCell setImagePosition:NSImageOnly];
>> [protoCell setTitle:@""];
>> [checkboxColumn setDataCell:protoCell];
>
> The protoCell should be released here. It is now retained by
> checkboxColumn.
I'll save Ondra the trouble by adding that you should autorelease
immediately upon init, avoiding the danger of memory leak due to
uncaught exception which might be raised in between separated init and
release messages.
(protoCell = [[[NSButtonCell alloc] init] autorelease]; )
--
Brent Gulanowski <email_removed>
I bought some batteries... but they weren't included... so I had to buy
them again. - Stephen Wright
_______________________________________________
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 : Thu Oct 03 21:46:59 2002
On Thursday, October 3, 2002, at 09:03 AM, Vladimir Pilipyuk wrote:
>> NSButtonCell *protoCell;
>>
>> protoCell=[[NSButtonCell alloc] init];
>> [protoCell setButtonType:NSSwitchButton];
>> [protoCell setImagePosition:NSImageOnly];
>> [protoCell setTitle:@""];
>> [checkboxColumn setDataCell:protoCell];
>
> The protoCell should be released here. It is now retained by
> checkboxColumn.
I'll save Ondra the trouble by adding that you should autorelease
immediately upon init, avoiding the danger of memory leak due to
uncaught exception which might be raised in between separated init and
release messages.
(protoCell = [[[NSButtonCell alloc] init] autorelease]; )
--
Brent Gulanowski <email_removed>
I bought some batteries... but they weren't included... so I had to buy
them again. - Stephen Wright
_______________________________________________
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.






Cocoa mail archive

