Commit 1d324176 authored by Max Kellermann's avatar Max Kellermann

lib/icu/Init: call u_init() and u_cleanup()

Make valgrind happy.
parent 37b31907
...@@ -19,11 +19,23 @@ ...@@ -19,11 +19,23 @@
#include "config.h" #include "config.h"
#include "Init.hxx" #include "Init.hxx"
#include "Error.hxx"
#include "Collate.hxx" #include "Collate.hxx"
#include "util/Error.hxx"
#include <unicode/uclean.h>
bool bool
IcuInit(Error &error) 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); return IcuCollateInit(error);
} }
...@@ -31,4 +43,6 @@ void ...@@ -31,4 +43,6 @@ void
IcuFinish() IcuFinish()
{ {
IcuCollateFinish(); IcuCollateFinish();
u_cleanup();
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment