diff --git a/ChangeLog b/ChangeLog index 7c736ab69..e0cf2a9e1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2009-03-19 Wolfgang Sourdeau + + * SoObjects/SOGo/SOGoUser.m ([SOGoUser + -homeFolderInContext:context]): no longer put the home folder in + cache, since it uses an context that is freed and invalidated + afterwards, which can cause crashes. + 2009-03-19 Ludovic Marcotte * Updated the sope.spec file wrt to changes diff --git a/Main/SOGo.m b/Main/SOGo.m index 5cff5c648..4e1cc9fc6 100644 --- a/Main/SOGo.m +++ b/Main/SOGo.m @@ -296,11 +296,16 @@ static BOOL debugObjectAllocation = NO; user = [SOGoUser userWithLogin: _key roles: nil]; if (user) - userFolder = [$(@"SOGoUserFolder") objectWithName: _key - inContainer: self]; + { + userFolder = [$(@"SOGoUserFolder") + objectWithName: _key + inContainer: self]; + } else userFolder = nil; + NSLog (@"userFolder: %p (%@)", userFolder, _key); + return userFolder; } @@ -349,6 +354,8 @@ static BOOL debugObjectAllocation = NO; } } + NSLog (@"SOGo: lookup: %p (%@)", obj, _key); + return obj; } diff --git a/SoObjects/SOGo/SOGoObject.m b/SoObjects/SOGo/SOGoObject.m index 2858b14d3..132089b0c 100644 --- a/SoObjects/SOGo/SOGoObject.m +++ b/SoObjects/SOGo/SOGoObject.m @@ -270,6 +270,7 @@ SEL SOGoSelectorForPropertySetter (NSString *property) if ((self = [self init])) { context = [[WOApplication application] context]; + NSLog (@"init [%p] context = %p", self, context); nameInContainer = [_name copy]; container = _container; if ([self doesRetainContainer]) @@ -1165,6 +1166,8 @@ SEL SOGoSelectorForPropertySetter (NSString *property) NSString *baseURL, *urlMethod, *fullHost; NSNumber *port; + NSLog (@"url [%p] context = %p", self, context); + serverURL = [context serverURL]; baseURL = [[self baseURLInContext: context] stringByUnescapingURL]; path = [NSMutableArray arrayWithArray: [baseURL componentsSeparatedByString: diff --git a/SoObjects/SOGo/SOGoUser.m b/SoObjects/SOGo/SOGoUser.m index 9ff25be4a..29e542c22 100644 --- a/SoObjects/SOGo/SOGoUser.m +++ b/SoObjects/SOGo/SOGoUser.m @@ -263,7 +263,6 @@ _timeValue (NSString *key) { allEmails = nil; currentPassword = nil; - homeFolder = nil; cn = nil; mailAccounts = nil; } @@ -281,7 +280,6 @@ _timeValue (NSString *key) { [allEmails release]; [currentPassword release]; - [homeFolder release]; [cn release]; [mailAccounts release]; [super dealloc]; @@ -855,15 +853,9 @@ _timeValue (NSString *key) - (SOGoUserFolder *) homeFolderInContext: (id) context { - if (!homeFolder) - { - homeFolder = [[WOApplication application] lookupName: [self login] - inContext: context - acquire: NO]; - [homeFolder retain]; - } - - return homeFolder; + return [[WOApplication application] lookupName: [self login] + inContext: context + acquire: NO]; } - (SOGoAppointmentFolders *) calendarsFolderInContext: (WOContext *) context