mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-05-19 10:25:27 +00:00
oc: Protect backend initialization to happen only once
This commit is contained in:
committed by
Julio García
parent
5b75c817e2
commit
1fc3a57210
@@ -140,8 +140,14 @@ sogo_backend_init (void)
|
||||
Class MAPIApplicationK;
|
||||
NSUserDefaults *ud;
|
||||
SoProductRegistry *registry;
|
||||
static BOOL moduleInitialized = NO;
|
||||
char *argv[] = { SAMBA_PREFIX "/sbin/samba", NULL };
|
||||
|
||||
if (moduleInitialized) {
|
||||
DEBUG(0, ("SOGo backend already initialized.\n"));
|
||||
return MAPISTORE_SUCCESS;
|
||||
}
|
||||
|
||||
GSRegisterCurrentThread ();
|
||||
pool = [NSAutoreleasePool new];
|
||||
|
||||
@@ -185,6 +191,7 @@ sogo_backend_init (void)
|
||||
[pool release];
|
||||
|
||||
DEBUG(0, ("[SOGo: %s:%d] backend init SUCCESS. Current thread: %p, pid: %d\n", __FUNCTION__, __LINE__, GSCurrentThread(), getpid()));
|
||||
moduleInitialized = YES;
|
||||
|
||||
return MAPISTORE_SUCCESS;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user