*/
void begin_burst(void)
{
- WC->WBuf = NewStrBufPlain(NULL, 32768);
+ if (WC->WBuf == NULL)
+ WC->WBuf = NewStrBufPlain(NULL, 32768);
}
pthread_attr_destroy(&attr);
}
+//#define DBG_PRINNT_HOOKS_AT_START
+#ifdef DBG_PRINNT_HOOKS_AT_START
const char foobuf[32];
const char *nix(void *vptr) {snprintf(foobuf, 32, "%0x", (long) vptr); return foobuf;}
+#endif
+void InitTemplateCache(void);
+
/*
* \brief Here's where it all begins.
* \param argc number of commandline args
char uds_listen_path[PATH_MAX]; /*< listen on a unix domain socket? */
HandlerHash = NewHash(1, NULL);
- initialise_modules();
+ PreferenceHooks = NewHash(1, NULL);
+ WirelessTemplateCache = NewHash(1, NULL);
+ WirelessLocalTemplateCache = NewHash(1, NULL);
+ LocalTemplateCache = NewHash(1, NULL);
+ TemplateCache = NewHash(1, NULL);
+ GlobalNS = NewHash(1, NULL);
+ Iterators = NewHash(1, NULL);
+
+
+#ifdef DBG_PRINNT_HOOKS_AT_START
dbg_PrintHash(HandlerHash, nix, NULL);
+#endif
/* Ensure that we are linked to the correct version of libcitadel */
if (libcitadel_version_number() < LIBCITADEL_VERSION_NUMBER) {
perror("chdir");
}
LoadIconDir(static_icon_dir);
+ InitTemplateCache();
+
+ initialise_modules();
initialize_viewdefs();
initialize_axdefs();
/* now the original thread becomes another worker */
worker_entry();
ShutDownLibCitadel ();
+ DeleteHash(&HandlerHash);
+ DeleteHash(&PreferenceHooks);
return 0;
}
icaltimezone_release_zone_tab ();
icalmemory_free_ring ();
ShutDownLibCitadel ();
+ DeleteHash(&HandlerHash);
+ DeleteHash(&PreferenceHooks);
+ DeleteHash(&GlobalNS);
+ DeleteHash(&WirelessTemplateCache);
+ DeleteHash(&WirelessLocalTemplateCache);
+ DeleteHash(&TemplateCache);
+ DeleteHash(&LocalTemplateCache);
+ DeleteHash(&Iterators);
+#ifdef ENABLE_NLS
+ void ShutdownLocale(void);
+#endif
lprintf(2, "master shutdown exiting!.\n");
exit(0);
}