diff options
author | Jeffrey Stedfast <fejj@novell.com> | 2004-06-19 04:07:09 +0800 |
---|---|---|
committer | Jeffrey Stedfast <fejj@src.gnome.org> | 2004-06-19 04:07:09 +0800 |
commit | 7f972efe0d2889052fbb49dceb28af5c9e1308a6 (patch) | |
tree | 6522abf8bd205f0bb3e30506eb9fcab3b78f52f8 /camel | |
parent | d1d0e8e307fc3fd65d15a407637129d529bb0668 (diff) | |
download | gsoc2013-evolution-7f972efe0d2889052fbb49dceb28af5c9e1308a6.tar gsoc2013-evolution-7f972efe0d2889052fbb49dceb28af5c9e1308a6.tar.gz gsoc2013-evolution-7f972efe0d2889052fbb49dceb28af5c9e1308a6.tar.bz2 gsoc2013-evolution-7f972efe0d2889052fbb49dceb28af5c9e1308a6.tar.lz gsoc2013-evolution-7f972efe0d2889052fbb49dceb28af5c9e1308a6.tar.xz gsoc2013-evolution-7f972efe0d2889052fbb49dceb28af5c9e1308a6.tar.zst gsoc2013-evolution-7f972efe0d2889052fbb49dceb28af5c9e1308a6.zip |
Call camel_mime_utils_shutdown() and camel_operation_shutdown().
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.
svn path=/trunk/; revision=26425
Diffstat (limited to 'camel')
-rw-r--r-- | camel/ChangeLog | 8 | ||||
-rw-r--r-- | camel/camel-mime-utils.c | 12 | ||||
-rw-r--r-- | camel/camel-mime-utils.h | 1 | ||||
-rw-r--r-- | camel/camel-operation.c | 11 | ||||
-rw-r--r-- | camel/camel.c | 4 |
5 files changed, 35 insertions, 1 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog index d2ceff25cc..0b1745b5b9 100644 --- a/camel/ChangeLog +++ b/camel/ChangeLog @@ -1,5 +1,13 @@ 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! diff --git a/camel/camel-mime-utils.c b/camel/camel-mime-utils.c index 4e5ec39ee3..6e7607f096 100644 --- a/camel/camel-mime-utils.c +++ b/camel/camel-mime-utils.c @@ -4246,7 +4246,7 @@ camel_mime_utils_init(void) 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; @@ -4264,3 +4264,13 @@ camel_mime_utils_init(void) 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); +} diff --git a/camel/camel-mime-utils.h b/camel/camel-mime-utils.h index 5fb23be36f..23987a5c16 100644 --- a/camel/camel-mime-utils.h +++ b/camel/camel-mime-utils.h @@ -114,6 +114,7 @@ struct _camel_header_newsgroup { /* 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); diff --git a/camel/camel-operation.c b/camel/camel-operation.c index 8718c52e99..7c641251b4 100644 --- a/camel/camel-operation.c +++ b/camel/camel-operation.c @@ -105,6 +105,17 @@ camel_operation_init(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. diff --git a/camel/camel.c b/camel/camel.c index 09ba07caf4..f370d891d0 100644 --- a/camel/camel.c +++ b/camel/camel.c @@ -46,6 +46,7 @@ static int initialised = FALSE; static void camel_shutdown (void) { + void camel_operation_shutdown (void); CamelCertDB *certdb; if (!initialised) @@ -63,6 +64,9 @@ camel_shutdown (void) camel_object_unref (certdb); } + camel_operation_shutdown (); + camel_mime_utils_shutdown (); + initialised = FALSE; } |