From bd4ef6874d0037ee85f25e6aeb9c4c5e4c361baa Mon Sep 17 00:00:00 2001 From: rowanbeentje Date: Sun, 14 Mar 2010 15:57:46 +0000 Subject: - Review copyWithZone: implementations and standardise on best practice recommendations --- Source/SPFavoriteTextFieldCell.m | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'Source/SPFavoriteTextFieldCell.m') diff --git a/Source/SPFavoriteTextFieldCell.m b/Source/SPFavoriteTextFieldCell.m index 446e8161..1ef39348 100644 --- a/Source/SPFavoriteTextFieldCell.m +++ b/Source/SPFavoriteTextFieldCell.m @@ -46,6 +46,8 @@ if ((self = [super init])) { mainStringColor = [NSColor blackColor]; subStringColor = [NSColor grayColor]; + favoriteName = nil; + favoriteHost = nil; } return self; @@ -59,10 +61,10 @@ SPFavoriteTextFieldCell *cell = (SPFavoriteTextFieldCell *)[super copyWithZone:zone]; cell->favoriteName = nil; - cell->favoriteName = [favoriteName retain]; + if (favoriteName) cell->favoriteName = [favoriteName copyWithZone:zone]; cell->favoriteHost = nil; - cell->favoriteHost = [favoriteHost retain]; + if (favoriteHost) cell->favoriteHost = [favoriteHost copyWithZone:zone]; return cell; } -- cgit v1.2.3