Opened 11 years ago
Closed 11 years ago
#5856 closed Bugs (wontfix)
memory leak occurs in regex::assign()
Reported by: | 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?
Note:
See TracTickets
for help on using tickets.
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.