[locale] Memory leaks?

Hello! I've been debugging my application that uses Boost.Locale for the past five hours or so, and I've found it curious that it leaks memory. In order to stop it, I have to do a couple of weird things, such as including ICU in to my projects and calling u_cleanup at the end of my application. I also have to disable certain facets. I've put all this together in some source code, that by default won't leak, but uncommenting various parts will cause it to leak: // ---- BEGIN CODE ---------------------------------------------------- #include <boost/locale.hpp> #include <unicode/uclean.h> #include <iostream> using namespace boost::locale; using namespace std; int main() { generator gen; gen.categories( convert_facet | //collation_facet | // Various errors. //formatting_facet | // Various errors. //parsing_facet | // Various errors. message_facet | //codepage_facet | // Various errors. boundary_facet | calendar_facet | information_facet); locale newLoc = gen("zh_CN.GB18030"); locale::global(newLoc); cout.imbue(newLoc); // ios_info::get doesn't clean up after itself. //cout << as::date << time(0) << endl; // Do this at the end of the program to clean up resources. locale::global(std::locale("C")); cout.imbue(std::locale("C")); u_cleanup(); } // ---- END CODE ------------------------------------------------------ Dumping this as 'hello.cpp' and running this is how I'm debugging it: g++ hello.cpp -lboost_locale -licuuc && valgrind --leak-check=full --show-reachable=yes ./a.out Thanks, Jookia.
participants (1)
-
Jookia