From 785aa3c23ed783629d54a4c4085be471714db626 Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Wed, 10 Aug 2011 18:33:13 +0000 Subject: [PATCH] Monotone-Parent: 5c85a1a1d9228ad7653497f882f4fccc69f1d924 Monotone-Revision: 6ebfad7c881ce0f2eee326f619d2e684e3f91df3 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2011-08-10T18:33:13 Monotone-Branch: ca.inverse.sogo --- OpenChange/MAPIStoreContext.m | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/OpenChange/MAPIStoreContext.m b/OpenChange/MAPIStoreContext.m index 8472d8807..ad848918b 100644 --- a/OpenChange/MAPIStoreContext.m +++ b/OpenChange/MAPIStoreContext.m @@ -203,10 +203,15 @@ _prepareContextClass (Class contextClass, withConnectionInfo: (struct mapistore_connection_info *) newConnInfo andTDBIndexing: (struct tdb_wrap *) indexingTdb { + NSString *username; + if ((self = [self init])) { ASSIGN (contextUrl, newUrl); - ASSIGN (mapping, [MAPIStoreMapping mappingWithIndexing: indexingTdb]); + username = [NSString stringWithUTF8String: newConnInfo->username]; + ASSIGN (mapping, [MAPIStoreMapping mappingForUsername: username + withIndexing: indexingTdb]); + [mapping increaseUseCount]; mstoreCtx = newConnInfo->mstore_ctx; connInfo = newConnInfo; } @@ -219,6 +224,7 @@ _prepareContextClass (Class contextClass, [baseFolder release]; [woContext release]; [authenticator release]; + [mapping decreaseUseCount]; [mapping release]; [contextUrl release];