Boost C++ Libraries: Ticket #3961: Memory leak on boost::posix_time::operator<< https://svn.boost.org/trac10/ticket/3961 <p> Valgrind reports a memory leak when streaming a boost::posix_time::ptime object. Attached both a sample main file, and the valgrind report. </p> <p> This occours both on gentoo linux with boost 1.41 and gcc 4.3.4 and on ubuntu with boost 1.73 and gcc 4.3.3 </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/3961 Trac 1.4.3 anonymous Thu, 25 Feb 2010 18:14:57 GMT attachment set https://svn.boost.org/trac10/ticket/3961 https://svn.boost.org/trac10/ticket/3961 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">memory_leak.cpp</span> </li> </ul> Ticket anonymous Thu, 25 Feb 2010 18:15:43 GMT attachment set https://svn.boost.org/trac10/ticket/3961 https://svn.boost.org/trac10/ticket/3961 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">valgrind_log</span> </li> </ul> Ticket Andrey Semashev Sat, 05 Jun 2010 08:47:39 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/3961#comment:1 https://svn.boost.org/trac10/ticket/3961#comment:1 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">invalid</span> </li> </ul> <p> I see no bug here. The facet is intended to be deleted by the locale (according to 22.1.1.1.2/2). I suspect that valgrind flags this as a leak since the locale of std::cout is never destroyed. </p> Ticket anonymous Wed, 16 Aug 2017 08:13:38 GMT <link>https://svn.boost.org/trac10/ticket/3961#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/3961#comment:2</guid> <description> <p> Why can't os.imbue(std::locale::classic()); be added at the end of the function to fix the "potential leak"? </p> </description> <category>Ticket</category> </item> </channel> </rss>