When I do
UErrorCode status = U_ZERO_ERROR;
icu::Transliterator* myTrans = Transliterator::createInstance("Latin-Greek", UTRANS_FORWARD, status);
myTrans->transliterate(...);
and have no further use for myTrans
, AddressSanitizer tells me it's leaking memory. I don't see methods like close
or free
in https://unicode-org.github.io/icu-docs/apidoc/released/icu4c/classicu_1_1Transliterator.html. There is unregister
but it will mean I can't create the same transliterator again, right?
A workaround which works in my particular case: declare
and use it in a static variable, so the destructor runs at the end of the program.