|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r83510 - trunk/boost/chrono/io
From: vicente.botet_at_[hidden]
Date: 2013-03-20 18:11:02
Author: viboes
Date: 2013-03-20 18:11:02 EDT (Wed, 20 Mar 2013)
New Revision: 83510
URL: http://svn.boost.org/trac/boost/changeset/83510
Log:
Chrono: avoid memory leak.
Text files modified:
trunk/boost/chrono/io/duration_units.hpp | 11 +++++++++++
1 files changed, 11 insertions(+), 0 deletions(-)
Modified: trunk/boost/chrono/io/duration_units.hpp
==============================================================================
--- trunk/boost/chrono/io/duration_units.hpp (original)
+++ trunk/boost/chrono/io/duration_units.hpp 2013-03-20 18:11:02 EDT (Wed, 20 Mar 2013)
@@ -978,6 +978,17 @@
duration_units_default_holder<CharT>::initialized_ = true;
}
}
+ ~duration_units_default_initializer_t()
+ {
+ if (duration_units_default_holder<CharT>::initialized_)
+ {
+ delete[] duration_units_default_holder<CharT>::n_d_valid_units_;
+ duration_units_default_holder<CharT>::n_d_valid_units_ = 0;
+ delete[] duration_units_default_holder<CharT>::valid_units_;
+ duration_units_default_holder<CharT>::valid_units_ = 0;
+ duration_units_default_holder<CharT>::initialized_ = false;
+ }
+ }
};
namespace /**/
{
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk