dovecot-2.2: lib-fts: Do all the ICU cleanup in fts_icu_deinit().

dovecot at dovecot.org dovecot at dovecot.org
Tue Jun 2 18:52:16 UTC 2015


details:   http://hg.dovecot.org/dovecot-2.2/rev/e2d42eab722f
changeset: 18800:e2d42eab722f
user:      Timo Sirainen <tss at iki.fi>
date:      Tue Jun 02 21:49:46 2015 +0300
description:
lib-fts: Do all the ICU cleanup in fts_icu_deinit().

diffstat:

 src/lib-fts/fts-filter.c |  6 ++----
 src/lib-fts/fts-icu.c    |  7 +++++++
 src/lib-fts/fts-icu.h    |  3 +++
 3 files changed, 12 insertions(+), 4 deletions(-)

diffs (56 lines):

diff -r 51194b531dd7 -r e2d42eab722f src/lib-fts/fts-filter.c
--- a/src/lib-fts/fts-filter.c	Tue Jun 02 21:45:46 2015 +0300
+++ b/src/lib-fts/fts-filter.c	Tue Jun 02 21:49:46 2015 +0300
@@ -3,10 +3,8 @@
 #include "lib.h"
 #include "array.h"
 #include "fts-language.h"
+#include "fts-icu.h"
 #include "fts-filter-private.h"
-#ifdef HAVE_LIBICU
-#  include <unicode/uclean.h>
-#endif
 
 static ARRAY(const struct fts_filter *) fts_filter_classes;
 
@@ -23,7 +21,7 @@
 void fts_filters_deinit(void)
 {
 #ifdef HAVE_LIBICU
-	u_cleanup();
+	fts_icu_deinit();
 #endif
 	array_free(&fts_filter_classes);
 }
diff -r 51194b531dd7 -r e2d42eab722f src/lib-fts/fts-icu.c
--- a/src/lib-fts/fts-icu.c	Tue Jun 02 21:45:46 2015 +0300
+++ b/src/lib-fts/fts-icu.c	Tue Jun 02 21:49:46 2015 +0300
@@ -5,6 +5,8 @@
 #include "unichar.h"
 #include "fts-icu.h"
 
+#include <unicode/uclean.h>
+
 void fts_icu_utf8_to_utf16(buffer_t *dest_utf16, const char *src_utf8)
 {
 	UErrorCode err = U_ZERO_ERROR;
@@ -108,3 +110,8 @@
 	buffer_set_used_size(dest_utf16, utf16_len * sizeof(UChar));
 	return 0;
 }
+
+void fts_icu_deinit(void)
+{
+	u_cleanup();
+}
diff -r 51194b531dd7 -r e2d42eab722f src/lib-fts/fts-icu.h
--- a/src/lib-fts/fts-icu.h	Tue Jun 02 21:45:46 2015 +0300
+++ b/src/lib-fts/fts-icu.h	Tue Jun 02 21:49:46 2015 +0300
@@ -14,4 +14,7 @@
 		      unsigned int src_len, UTransliterator *transliterator,
 		      const char **error_r);
 
+/* Free all the memory used by ICU functions. */
+void fts_icu_deinit(void);
+
 #endif


More information about the dovecot-cvs mailing list