From e0418b2822ac20bf6bb13ed3244a2a76b346c661 Mon Sep 17 00:00:00 2001 From: Stefan Bidigaray Date: Sun, 23 Jan 2011 15:53:02 +0000 Subject: [PATCH] Minor memory management fix. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@31932 72102866-910b-0410-8b05-ffd578937521 --- Source/NSDateFormatter.m | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/Source/NSDateFormatter.m b/Source/NSDateFormatter.m index 8c49ebe99..46614d07d 100644 --- a/Source/NSDateFormatter.m +++ b/Source/NSDateFormatter.m @@ -85,8 +85,8 @@ static NSDateFormatterBehavior _defaultBehavior = 0; return nil; _behavior = _defaultBehavior; - _locale = [NSLocale currentLocale]; - _tz = [NSTimeZone defaultTimeZone]; + _locale = RETAIN([NSLocale currentLocale]); + _tz = RETAIN([NSTimeZone defaultTimeZone]); /* According to Apple docs, default behavior is NSDateFormatterBehavior10_4 on 10.5 and later. Yeah, go figure. */ @@ -429,8 +429,7 @@ static NSDateFormatterBehavior _defaultBehavior = 0; { if (locale == _locale) return; - if (_locale != nil) - RELEASE(_locale); + RELEASE(_locale); _locale = RETAIN(locale); [self _resetUDateFormat]; @@ -445,8 +444,7 @@ static NSDateFormatterBehavior _defaultBehavior = 0; { if (tz == _tz) return; - if (_tz != nil) - RELEASE(_tz); + RELEASE(_tz); _tz = RETAIN(tz); [self _resetUDateFormat];