From: Piotr Caban Subject: [PATCH] msvcrt: Update lc_category.wrefcount in __get_current_locale. Message-Id: <92c4730f-b104-a3a0-880f-3b13252c9d1b@codeweavers.com> Date: Mon, 23 Nov 2020 11:11:49 +0100 Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50163 Signed-off-by: Piotr Caban --- dlls/msvcrt/locale.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dlls/msvcrt/locale.c b/dlls/msvcrt/locale.c index 236eaae1f1c..7041afb1914 100644 --- a/dlls/msvcrt/locale.c +++ b/dlls/msvcrt/locale.c @@ -1155,7 +1155,11 @@ MSVCRT__locale_t CDECL get_current_locale_noalloc(MSVCRT__locale_t locale) InterlockedIncrement(&locale->locinfo->refcount); for(i=MSVCRT_LC_MIN+1; i<=MSVCRT_LC_MAX; i++) + { InterlockedIncrement(locale->locinfo->lc_category[i].refcount); + if(locale->locinfo->lc_category[i].wrefcount) + InterlockedIncrement(locale->locinfo->lc_category[i].wrefcount); + } if(locale->locinfo->lconv_intl_refcount) InterlockedIncrement(locale->locinfo->lconv_intl_refcount); if(locale->locinfo->lconv_num_refcount)