diff --git a/ChangeLog b/ChangeLog index c6309fcda..a2ba604f4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2012-02-01 Wolfgang Sourdeau + * OpenChange/MAPIStoreUserContext.m (-destroy): dont't release + "username" as it is not initially retained. + (+userContextWithUsername:andTDBIndexing:): the resulting instance + is cached in the table from here instead. + * OpenChange/MAPIStoreTable.m (-destroyHandle:): skih operation if the handle parameter is 0. diff --git a/OpenChange/MAPIStoreUserContext.m b/OpenChange/MAPIStoreUserContext.m index b2b97babc..222f1d560 100644 --- a/OpenChange/MAPIStoreUserContext.m +++ b/OpenChange/MAPIStoreUserContext.m @@ -61,6 +61,7 @@ static NSMapTable *contextsTable = nil; userContext = [[self alloc] initWithUsername: username andTDBIndexing: indexingTdb]; [userContext autorelease]; + [contextsTable setObject: userContext forKey: username]; } return userContext; @@ -97,11 +98,9 @@ static NSMapTable *contextsTable = nil; if (indexingTdb) ASSIGN (mapping, [MAPIStoreMapping mappingForUsername: username withIndexing: indexingTdb]); - [contextsTable setObject: self forKey: username]; authenticator = [MAPIStoreAuthenticator new]; [authenticator setUsername: username]; - /* TODO: very hackish (IMAP access) */ [authenticator setPassword: username]; } @@ -118,7 +117,6 @@ static NSMapTable *contextsTable = nil; [authenticator release]; [mapping release]; - [username release]; [sogoUser release]; [contextsTable removeObjectForKey: username];