aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-06-10 22:45:50 +0200
committerMax Kellermann <max@duempel.org>2014-06-10 23:21:09 +0200
commit1d324176d1e2524c92f6c1f474e30da4b03e636f (patch)
tree9d8529cd62b31e766bcb309c9d1d7ddd68d8e6ec
parent37b31907525dd3554924ec4144f4345993579376 (diff)
downloadmpd-1d324176d1e2524c92f6c1f474e30da4b03e636f.tar.gz
mpd-1d324176d1e2524c92f6c1f474e30da4b03e636f.tar.xz
mpd-1d324176d1e2524c92f6c1f474e30da4b03e636f.zip
lib/icu/Init: call u_init() and u_cleanup()
Make valgrind happy.
-rw-r--r--src/lib/icu/Init.cxx14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/lib/icu/Init.cxx b/src/lib/icu/Init.cxx
index e6c0814d8..1d0ad0777 100644
--- a/src/lib/icu/Init.cxx
+++ b/src/lib/icu/Init.cxx
@@ -19,11 +19,23 @@
#include "config.h"
#include "Init.hxx"
+#include "Error.hxx"
#include "Collate.hxx"
+#include "util/Error.hxx"
+
+#include <unicode/uclean.h>
bool
IcuInit(Error &error)
{
+ UErrorCode code = U_ZERO_ERROR;
+ u_init(&code);
+ if (U_FAILURE(code)) {
+ error.Format(icu_domain, int(code),
+ "u_init() failed: %s", u_errorName(code));
+ return false;
+ }
+
return IcuCollateInit(error);
}
@@ -31,4 +43,6 @@ void
IcuFinish()
{
IcuCollateFinish();
+
+ u_cleanup();
}