Opened 13 years ago

Closed 12 years ago

Last modified 5 years ago

#3961 closed Bugs (invalid)

Memory leak on boost::posix_time::operator<<

Reported by: david.dilorenzo@… Owned by: az_sw_dude
Milestone: Component: date_time
Version: Boost 1.41.0 Severity: Problem
Keywords: Cc:

Description

Valgrind reports a memory leak when streaming a boost::posix_time::ptime object. Attached both a sample main file, and the valgrind report.

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

Attachments (2)

memory_leak.cpp (314 bytes ) - added by anonymous 13 years ago.
valgrind_log (8.7 KB ) - added by anonymous 13 years ago.

Download all attachments as: .zip

Change History (4)

by anonymous, 13 years ago

Attachment: memory_leak.cpp added

by anonymous, 13 years ago

Attachment: valgrind_log added

comment:1 by Andrey Semashev, 12 years ago

Resolution: invalid
Status: newclosed

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.

comment:2 by anonymous, 5 years ago

Why can't os.imbue(std::locale::classic()); be added at the end of the function to fix the "potential leak"?

Note: See TracTickets for help on using tickets.