File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -60,23 +60,25 @@ scoped_c_thread_locale::xplat_locale scoped_c_thread_locale::c_locale()
60
60
scoped_c_thread_locale::xplat_locale *clocale = new scoped_c_thread_locale::xplat_locale ();
61
61
#ifdef _WIN32
62
62
*clocale = _create_locale (LC_ALL, " C" );
63
- if (clocale == nullptr )
63
+ if (* clocale == nullptr )
64
64
{
65
65
throw std::runtime_error (" Unable to create 'C' locale." );
66
66
}
67
67
auto deleter = [](scoped_c_thread_locale::xplat_locale *clocale)
68
68
{
69
69
_free_locale (*clocale);
70
+ delete clocale;
70
71
};
71
72
#else
72
73
*clocale = newlocale (LC_ALL, " C" , nullptr );
73
- if (clocale == nullptr )
74
+ if (* clocale == nullptr )
74
75
{
75
76
throw std::runtime_error (" Unable to create 'C' locale." );
76
77
}
77
78
auto deleter = [](scoped_c_thread_locale::xplat_locale *clocale)
78
79
{
79
80
freelocale (*clocale);
81
+ delete clocale;
80
82
};
81
83
#endif
82
84
g_c_locale = std::unique_ptr<scoped_c_thread_locale::xplat_locale, void (*)(scoped_c_thread_locale::xplat_locale *)>(clocale, deleter);
You can’t perform that action at this time.
0 commit comments