Boost C++ Libraries: Ticket #5856: memory leak occurs in regex::assign() https://svn.boost.org/trac10/ticket/5856 <p> I am having a windows console app that dynamically links to the regex lib. On application shutdown the memory leak detection kicks in and diagnoses leaks in the regex dll. </p> <p> My project structure is </p> <blockquote> <p> <a class="missing wiki">RegWrapper</a>.dll -&gt; MTd <a class="missing wiki">MyApp</a>.exe -&gt; MTd </p> </blockquote> <p> If I change my dll compiler option from MTd to MDd then It works fine(no leak). </p> <p> My leak point is, </p> <blockquote> <p> boost::regex r; r.assign("ABC"); &lt;-- detection </p> </blockquote> <p> Any ideas? </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/5856 Trac 1.4.3 anonymous Fri, 02 Sep 2011 12:10:56 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/5856#comment:1 https://svn.boost.org/trac10/ticket/5856#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">wontfix</span> </li> </ul> <p> Boost.Regex does cache some data (mostly locale related stuff) for performance reasons. This <em>does</em> get cleaned up at program exit, but depending upon when _CrtDumpMemoryLeaks() is called the data may still be in existance at that point giving the appearance of memory leaks. </p> <p> Other tools like Visual Leak Detector, or Valgrind are smart enough not to generate these false positives, and provide much better diagnostic info than the MS tools which IMO are next to useless for tracking issues down. </p> <p> HTH, John. </p> Ticket