aboutsummaryrefslogtreecommitdiff
path: root/libstdc++-v3/config/locale/generic/time_members.h
diff options
context:
space:
mode:
Diffstat (limited to 'libstdc++-v3/config/locale/generic/time_members.h')
-rw-r--r--libstdc++-v3/config/locale/generic/time_members.h13
1 files changed, 11 insertions, 2 deletions
diff --git a/libstdc++-v3/config/locale/generic/time_members.h b/libstdc++-v3/config/locale/generic/time_members.h
index 03c31d1797e..8db2cb53ed8 100644
--- a/libstdc++-v3/config/locale/generic/time_members.h
+++ b/libstdc++-v3/config/locale/generic/time_members.h
@@ -36,7 +36,15 @@
template<typename _CharT>
__timepunct<_CharT>::__timepunct(size_t __refs)
- : locale::facet(__refs)
+ : facet(__refs), _M_data(NULL)
+ {
+ _M_name_timepunct = _S_c_name;
+ _M_initialize_timepunct();
+ }
+
+ template<typename _CharT>
+ __timepunct<_CharT>::__timepunct(__cache_type* __cache, size_t __refs)
+ : facet(__refs), _M_data(__cache)
{
_M_name_timepunct = _S_c_name;
_M_initialize_timepunct();
@@ -45,7 +53,7 @@
template<typename _CharT>
__timepunct<_CharT>::__timepunct(__c_locale __cloc, const char* __s,
size_t __refs)
- : locale::facet(__refs)
+ : facet(__refs), _M_data(NULL)
{
_M_name_timepunct = new char[strlen(__s) + 1];
strcpy(_M_name_timepunct, __s);
@@ -57,5 +65,6 @@
{
if (_S_c_name != _M_name_timepunct)
delete [] _M_name_timepunct;
+ delete _M_data;
_S_destroy_c_locale(_M_c_locale_timepunct);
}