X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=webcit%2Fgettext.c;h=52332f8152b64a4db519d1e8403c808749969745;hb=4c9df9f5ffac933f2fe42b3f05de98dcd8adf8f0;hp=f044ab6ac9ac9f619f4baeee22797f2ed969c090;hpb=8370691fac5f01106c9d1ca16053e0bc9ea5dfef;p=citadel.git diff --git a/webcit/gettext.c b/webcit/gettext.c index f044ab6ac..52332f815 100644 --- a/webcit/gettext.c +++ b/webcit/gettext.c @@ -270,6 +270,11 @@ void preset_locale(void) #endif #endif } + +#ifdef HAVE_USELOCALE + locale_t Empty_Locale; +#endif + /** * \brief Create a locale_t for each available language */ @@ -278,8 +283,6 @@ void initialize_locales(void) { char buf[32]; #ifdef HAVE_USELOCALE - locale_t Empty_Locale; - /* create default locale */ Empty_Locale = newlocale(LC_ALL_MASK, NULL, NULL); #endif @@ -310,6 +313,17 @@ void initialize_locales(void) { } } +void ShutdownLocale(void) +{ + int i; +#ifdef HAVE_USELOCALE + for (i = 0; i < NUM_LANGS; ++i) { + if (Empty_Locale != wc_locales[i]) + freelocale(wc_locales[i]); + } + freelocale(Empty_Locale); +#endif +} #else /* ENABLE_NLS */ /** \brief dummy for non NLS enabled systems */