id,summary,reporter,owner,description,type,status,milestone,component,version,severity,resolution,keywords,cc 8079,Chrono memory leak,dm413-boost@…,viboes,"The constructor for duration_units_default_initializer_t (in chrono/io/duration_units.hpp) allocates two string_type arrays from the heap but never deletes them. The Visual C++ MFC debugger reports this as a memory leak (and I expect most other leak detectors will as well). These variables are class static and only one instance of this class (per CharT) is allocated anyway, so this is not a ""serious"" memory leak, but any memory leak reported by a leak detector is worth fixing to avoid masking other more serious memory leaks. I suggest adding a destructor similar to this: {{{ ~duration_units_default_initializer_t() { if (duration_units_default_holder::initialized_) { delete[] duration_units_default_holder::n_d_valid_units_; duration_units_default_holder::n_d_valid_units_ = 0; delete[] duration_units_default_holder::valid_units_; duration_units_default_holder::valid_units_ = 0; duration_units_default_holder::initialized_ = false; } } }}} Further suggestions for this code: 1. Make the class static member variables n_d_valid_units_ and valid_units_ into non-static member variables. Only one object of this type is created, so making them them regular member variables makes things clearer and simplifies the code. 2. Do away with the initialized_ member variable entirely. If you make the other member variables non-static, there is no need for this variable. 3. If I am wrong and it is possible to create more than one instance of duration_units_default_initializer_t, then you will need to make the destructor more intelligent and use smart pointers or a reference count to know when to destroy the static member variables. ",Bugs,closed,Boost 1.54.0,chrono,Boost 1.53.0,Problem,fixed,,