The std::locale takes ownership of it and frees it when it goes out of scope