diff --git a/ChangeLog b/ChangeLog index 99ff6839a..b6b25b5de 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2009-03-25 Francis Lachapelle + + * SoObjects/SOGo/SOGoUser.m ([SOGoUser -language]): must retain + the ivar language to avoid a crash if the language is retrieved + from the user agent header returned by the browser. + 2009-03-24 Wolfgang Sourdeau * UI/Scheduler/UIxComponentEditor.m ([UIxComponentEditor diff --git a/SoObjects/SOGo/SOGoUser.m b/SoObjects/SOGo/SOGoUser.m index 3d242f247..abcd0499b 100644 --- a/SoObjects/SOGo/SOGoUser.m +++ b/SoObjects/SOGo/SOGoUser.m @@ -280,6 +280,7 @@ _timeValue (NSString *key) [allEmails release]; [currentPassword release]; [cn release]; + [language release]; [super dealloc]; } @@ -465,7 +466,7 @@ _timeValue (NSString *key) if (values) { // See explanation in -language - language = nil; + [self invalidateLanguage]; // Required parameters for the Web interface. This will trigger the // preferences to load so it's important to leave those calls here. @@ -522,7 +523,7 @@ _timeValue (NSString *key) if (values) { // See explanation in -language - language = nil; + [self invalidateLanguage]; // We propagate the loaded user settings to other sogod instances // which will cache them in SOGoCache (including for the instance @@ -550,7 +551,7 @@ _timeValue (NSString *key) - (void) invalidateLanguage { - language = nil; + DESTROY(language); } - (NSString *) language @@ -563,6 +564,8 @@ _timeValue (NSString *key) // many times when the DB is down, causing a huge delay. if (![language length]) language = [SOGoUser language]; + + [language retain]; } return language;