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

Make valgrind happy.
This commit is contained in:
Max Kellermann 2014-06-10 22:45:50 +02:00
parent 37b3190752
commit 1d324176d1
1 changed files with 14 additions and 0 deletions

View File

@ -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();
}