Opened 11 years ago

Closed 11 years ago

#5856 closed Bugs (wontfix)

memory leak occurs in regex::assign()

Reported by: crash204@… Owned by: John Maddock
Milestone: To Be Determined Component: regex
Version: Boost 1.46.1 Severity: Problem
Keywords: memory leak Cc:

Description

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.

My project structure is

RegWrapper.dll -> MTd MyApp.exe -> MTd

If I change my dll compiler option from MTd to MDd then It works fine(no leak).

My leak point is,

boost::regex r; r.assign("ABC"); <-- detection

Any ideas?

Change History (1)

comment:1 by anonymous, 11 years ago

Resolution: wontfix
Status: newclosed

Boost.Regex does cache some data (mostly locale related stuff) for performance reasons. This does 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.

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.

HTH, John.

Note: See TracTickets for help on using tickets.