2004-06-18 Jeffrey Stedfast <fejj@novell.com>
+ * camel.c (camel_shutdown): Call camel_mime_utils_shutdown() and
+ camel_operation_shutdown().
+
+ * camel-operation.c (camel_operation_shutdown): New function.
+
+ * camel-mime-utils.c (camel_mime_utils_shutdown): New function to
+ clean up the compiled regexes.
+
* camel-stream-buffer.c (set_vbuf): Need to re-init sbf->ptr and
sbf->end too, or we'll be sorrryy!
base64_init();
/* precompile regex's for speed at runtime */
- for (i = 0; i < sizeof(mail_list_magic) / sizeof(mail_list_magic[0]); i++) {
+ for (i = 0; i < G_N_ELEMENTS (mail_list_magic); i++) {
errcode = regcomp(&mail_list_magic[i].regex, mail_list_magic[i].pattern, REG_EXTENDED|REG_ICASE);
if (errcode != 0) {
char *errstr;
g_assert(regex_compilation_failed == 0);
}
+
+
+void
+camel_mime_utils_shutdown (void)
+{
+ int i;
+
+ for (i = 0; i < G_N_ELEMENTS (mail_list_magic); i++)
+ regfree (&mail_list_magic[i].regex);
+}
/* MUST be called before everything else */
void camel_mime_utils_init(void);
+void camel_mime_utils_shutdown (void);
/* Address lists */
struct _camel_header_address *camel_header_address_new (void);
}
/**
+ * camel_operation_shutdown:
+ *
+ * Cleans up internal variables.
+ **/
+void
+camel_operation_shutdown (void)
+{
+ pthread_key_delete (&operation_key);
+}
+
+/**
* camel_operation_new:
* @status: Callback for receiving status messages. This will always
* be called with an internal lock held.
static void
camel_shutdown (void)
{
+ void camel_operation_shutdown (void);
CamelCertDB *certdb;
if (!initialised)
camel_object_unref (certdb);
}
+ camel_operation_shutdown ();
+ camel_mime_utils_shutdown ();
+
initialised = FALSE;
}