From 1d324176d1e2524c92f6c1f474e30da4b03e636f Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 10 Jun 2014 22:45:50 +0200 Subject: lib/icu/Init: call u_init() and u_cleanup() Make valgrind happy. --- src/lib/icu/Init.cxx | 14 ++++++++++++++ 1 file changed, 14 insertions(+) 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 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(); } -- cgit v1.2.3