Monotone-Parent: cd4c34d79c62c8b6a1f9ccfb14ea9a79442034c6

Monotone-Revision: ff50144aaefa18bc1bf88723bc25f1f6b4962451

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2012-03-16T20:53:04
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Wolfgang Sourdeau
2012-03-16 20:53:04 +00:00
parent 3ad93f3257
commit 5b424d6969
2 changed files with 24 additions and 0 deletions
+20
View File
@@ -23,6 +23,7 @@
/* OpenChange SOGo storage backend */
#import <Foundation/NSAutoreleasePool.h>
#import <Foundation/NSDebug.h>
#import <Foundation/NSFileHandle.h>
#import <Foundation/NSProcessInfo.h>
#import <Foundation/NSUserDefaults.h>
@@ -48,6 +49,7 @@
#include <mapistore/mapistore_errors.h>
static Class MAPIStoreContextK = Nil;
static BOOL leakDebugging = NO;
static enum mapistore_error
sogo_backend_unexpected_error()
@@ -57,6 +59,16 @@ sogo_backend_unexpected_error()
return MAPISTORE_SUCCESS;
}
static void
sogo_backend_atexit (void)
{
NSAutoreleasePool *pool;
pool = [NSAutoreleasePool new];
NSLog (@"allocated classes:\n%s", GSDebugAllocationList (YES));
[pool release];
}
/**
\details Initialize sogo mapistore backend
@@ -89,6 +101,14 @@ sogo_backend_init (void)
ud = [NSUserDefaults standardUserDefaults];
[ud registerDefaults: [ud persistentDomainForName: @"sogod"]];
if (!leakDebugging && [ud boolForKey: @"SOGoDebugLeaks"])
{
NSLog (@" leak debugging on");
GSDebugAllocationActive (YES);
atexit (sogo_backend_atexit);
leakDebugging = YES;
}
registry = [SoProductRegistry sharedProductRegistry];
[registry scanForProductsInDirectory: SOGO_BUNDLES_DIR];