From e6dabdd700a9c4b76e66bb6e7cc8beca3bd1aeeb Mon Sep 17 00:00:00 2001 From: "gtm.daemon" Date: Mon, 24 Aug 2009 15:45:19 +0000 Subject: [Author: dmaclach] Standardize how we call free. No need to check for NULL. R=thomasvl DELTA=24 (0 added, 13 deleted, 11 changed) --- Foundation/GTMRegex.m | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) (limited to 'Foundation/GTMRegex.m') diff --git a/Foundation/GTMRegex.m b/Foundation/GTMRegex.m index 1027224..4c393a6 100644 --- a/Foundation/GTMRegex.m +++ b/Foundation/GTMRegex.m @@ -514,10 +514,7 @@ static NSString *const kReplacementPattern = // Don't need a finalize because savedRegMatches_ is marked __strong - (void)dealloc { - if (savedRegMatches_) { - free(savedRegMatches_); - savedRegMatches_ = nil; - } + free(savedRegMatches_); [regex_ release]; [utf8StrBuf_ release]; [super dealloc]; @@ -656,8 +653,7 @@ static NSString *const kReplacementPattern = } @catch (id e) { // COV_NF_START - no real way to force this in a test _GTMDevLog(@"Exceptions while trying to advance enumeration (%@)", e); // if we still have something in our temp, free it - if (nextMatches) - free(nextMatches); + free(nextMatches); } // COV_NF_END return result; @@ -685,10 +681,7 @@ static NSString *const kReplacementPattern = } - (void)dealloc { - if (regMatches_) { - free(regMatches_); - regMatches_ = nil; - } + free(regMatches_); [utf8StrBuf_ release]; [super dealloc]; } -- cgit v1.2.3