From 578f01bd5e0bcb5bc8df13222eda16fd84d25ef5 Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Thu, 19 Mar 2009 15:42:58 +0000 Subject: [PATCH] Monotone-Parent: 004c96fa075fbca45fa523b3bb73737aa0ce34a1 Monotone-Revision: 1892d22bfa9e855fd8c40d3f7f4b97d3637cb141 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2009-03-19T15:42:58 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 7 +++++++ Main/SOGo.m | 11 +++++++++-- SoObjects/SOGo/SOGoObject.m | 3 +++ SoObjects/SOGo/SOGoUser.m | 14 +++----------- 4 files changed, 22 insertions(+), 13 deletions(-) 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