summaryrefslogtreecommitdiff
path: root/locale.c
diff options
context:
space:
mode:
Diffstat (limited to 'locale.c')
-rw-r--r--locale.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/locale.c b/locale.c
index 93f97b1082..8c98b3269c 100644
--- a/locale.c
+++ b/locale.c
@@ -2609,14 +2609,18 @@ S_wrap_wsetlocale(pTHX_ const int category, const char *locale)
}
}
+ WSETLOCALE_LOCK;
const wchar_t * wresult = _wsetlocale(category, wlocale);
Safefree(wlocale);
if (! wresult) {
+ WSETLOCALE_UNLOCK;
return NULL;
}
const char * result = Win_wstring_to_utf8_string(wresult);
+ WSETLOCALE_UNLOCK;
+
SAVEFREEPV(result); /* is there something better we can do here? */
return result;