From a89a3dab8050c1dbf0c125d44d45ff67b43703cb Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Sat, 10 Aug 2002 23:55:20 +0000 Subject: 2002-08-10 Roland McGrath * locale/loadarchive.c (_nl_archive_subfreeres): New function. * locale/localeinfo.h: Declare it. * locale/setlocale.c (free_mem): Don't call _nl_unload_locale on the current locale if it's not in the file list. Call _nl_archive_subfreeres. * include/wctype.h (iswalpha, iswdigit, iswlower, iswspace, iswxdigit, towlower, towupper): Add prototypes here too. Add libc_hidden_proto. * wctype/wcfuncs.c (iswalpha, iswdigit, iswlower, iswspace, iswxdigit, towlower, towupper): Add libc_hidden_weak. --- locale/setlocale.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'locale/setlocale.c') diff --git a/locale/setlocale.c b/locale/setlocale.c index 46af339eae..3c80379cf9 100644 --- a/locale/setlocale.c +++ b/locale/setlocale.c @@ -458,12 +458,10 @@ free_mem (void) /* If this category is already "C" don't do anything. */ if (here != _nl_C[category]) { - /* We have to be prepared that sometime later me still + /* We have to be prepared that sometime later we still might need the locale information. */ setdata (category, _nl_C[category]); setname (category, _nl_C_name); - - _nl_unload_locale (here); } while (runp != NULL) @@ -471,7 +469,7 @@ free_mem (void) struct loaded_l10nfile *curr = runp; struct locale_data *data = (struct locale_data *) runp->data; - if (data != NULL && data != here && data != _nl_C[category]) + if (data != NULL && data != _nl_C[category]) _nl_unload_locale (data); runp = runp->next; free ((char *) curr->filename); @@ -480,5 +478,10 @@ free_mem (void) } setname (LC_ALL, _nl_C_name); + + /* This frees the data structures associated with the locale archive. + The locales from the archive are not in the file list, so we have + not called _nl_unload_locale on them above. */ + _nl_archive_subfreeres (); } text_set_element (__libc_subfreeres, free_mem); -- cgit v1.2.1