Monotone-Parent: 5c6353cb6270d51a457d46a8fe98dadae4f37193

Monotone-Revision: 0e4c262d0f94e6fb1bccfcb58387684c97728cfc

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2011-07-11T15:29:04
Monotone-Branch: ca.inverse.sogo
maint-2.0.2
Wolfgang Sourdeau 2011-07-11 15:29:04 +00:00
parent 34f2904f0d
commit cad140c0b2
3 changed files with 43 additions and 0 deletions

View File

@ -1,3 +1,9 @@
2011-07-11 Wolfgang Sourdeau <wsourdeau@inverse.ca>
* OpenChange/NSObject+MAPIStore.m (-tallocWrapper:): new method
enabling the wrapping of obj-c objects into talloc structures, in
order to ease memory management.
2011-07-08 Francis Lachapelle <flachapelle@inverse.ca>
* UI/MailerUI/UIxMailListActions.m (-getUIDsAndHeadersInFolder)

View File

@ -27,6 +27,17 @@
#include <talloc.h>
struct MAPIStoreTallocWrapper
{
id MAPIStoreSOGoObject;
};
@interface NSObject (MAPIStoreTallocHelpers)
- (struct MAPIStoreTallocWrapper *) tallocWrapper: (TALLOC_CTX *) tallocCtx;
@end
@interface NSObject (MAPIStoreDataTypes)
- (enum MAPISTATUS) getMAPIValue: (void **) data

View File

@ -32,6 +32,32 @@
#undef DEBUG
#include <mapistore/mapistore.h>
@implementation NSObject (MAPIStoreTallocHelpers)
static int MAPIStoreTallocWrapperDestroy (void *data)
{
id wrappedObject;
wrappedObject = data;
[wrappedObject release];
return 0;
}
- (struct MAPIStoreTallocWrapper *) tallocWrapper: (TALLOC_CTX *) tallocCtx
{
struct MAPIStoreTallocWrapper *wrapper;
wrapper = talloc_zero (tallocCtx, struct MAPIStoreTallocWrapper);
wrapper->MAPIStoreSOGoObject = self;
talloc_set_destructor ((void *) wrapper, MAPIStoreTallocWrapperDestroy);
[self retain];
return wrapper;
}
@end
@implementation NSObject (MAPIStoreDataTypes)
- (enum MAPISTATUS) getMAPIValue: (void **) data