I've had to neuter some setlocale() in mlt, since our code is definitely NOT thread-safe. No biggie, since we do not have support for LC_NUMERIC right now.
I think we might want the thread-specific functions, namely stuff like strtod_l, or sprintf_l and friends. Even if they do not do anything specific right now with a locale object, at least they would prevent re-entrency issues. Note that the current issue is a time-bomb, because it is a race, so it does only manifest itself as a double free in freegl... uselocale is fine, but it is not on windows, so highly portable code tends to prefer strtod_l...