aboutsummaryrefslogtreecommitdiff
path: root/wcsmbs
diff options
context:
space:
mode:
authorFlorian Weimer <fweimer@redhat.com>2022-05-23 10:08:18 +0200
committerFlorian Weimer <fweimer@redhat.com>2022-05-23 11:06:31 +0200
commitbbebe83a2874cd25934046d908824dfc11711a2b (patch)
tree1e4b6818e4fc8c35996da79471d55048095f7650 /wcsmbs
parent0b6342e769be6903f29da067f5cbcbfcc7c01b10 (diff)
downloadglibc-bbebe83a2874cd25934046d908824dfc11711a2b.zip
glibc-bbebe83a2874cd25934046d908824dfc11711a2b.tar.gz
glibc-bbebe83a2874cd25934046d908824dfc11711a2b.tar.bz2
locale: Remove cleanup function pointer from struct __localedata
We can call the cleanup functions directly from _nl_unload_locale if we pass the category to it. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Diffstat (limited to 'wcsmbs')
-rw-r--r--wcsmbs/wcsmbsload.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/wcsmbs/wcsmbsload.c b/wcsmbs/wcsmbsload.c
index ffb5cb7..af539a0 100644
--- a/wcsmbs/wcsmbsload.c
+++ b/wcsmbs/wcsmbsload.c
@@ -202,10 +202,7 @@ __wcsmbs_load_conv (struct __locale_data *new_category)
new_category->private.ctype = &__wcsmbs_gconv_fcts_c;
}
else
- {
- new_category->private.ctype = new_fcts;
- new_category->private.cleanup = &_nl_cleanup_ctype;
- }
+ new_category->private.ctype = new_fcts;
}
__libc_rwlock_unlock (__libc_setlocale_lock);
@@ -267,10 +264,9 @@ void
_nl_cleanup_ctype (struct __locale_data *locale)
{
const struct gconv_fcts *const data = locale->private.ctype;
- if (data != NULL)
+ if (data != NULL && data != &__wcsmbs_gconv_fcts_c)
{
locale->private.ctype = NULL;
- locale->private.cleanup = NULL;
/* Free the old conversions. */
__gconv_close_transform (data->tomb, data->tomb_nsteps);