From ed4ca3bd1b2cba344892cf80fc94af288ca15e03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Garc=C3=ADa=20S=C3=A1ez?= Date: Thu, 28 Aug 2014 04:19:28 +0200 Subject: [PATCH] oc: add talloc reference to indexing context We have a cache with user contexts (objc) which have mapping contexts (objc) where we store the indexing context (c) which will be freed by openchange code once the connection is closed. Right now all indexing context created for an user are the same, independently when in time was created or by which connection, etc... So this is a valid workaround, but this has to be refactored to used the indexing context of the current connection that is performing the call to SOGo backend. --- OpenChange/MAPIStoreMapping.m | 3 +++ 1 file changed, 3 insertions(+) diff --git a/OpenChange/MAPIStoreMapping.m b/OpenChange/MAPIStoreMapping.m index 194488bc7..516f1a079 100644 --- a/OpenChange/MAPIStoreMapping.m +++ b/OpenChange/MAPIStoreMapping.m @@ -114,6 +114,9 @@ MAPIStoreMappingKeyFromId (uint64_t idNbr) { ASSIGN (username, newUsername); indexing = newIndexing; + /* Workaround so all indexing context are valid and won't be freed. */ + // TODO refactor indexing interface + talloc_reference(memCtx, indexing); } return self;