Opened 13 years ago

Closed 13 years ago

#3870 closed Bugs (fixed)

memory leak when deserialising a map containing shared_ptrs

Reported by: Richard Bradley <ricbrad@…> Owned by: Robert Ramey
Milestone: Boost 1.42.0 Component: serialization
Version: Boost 1.41.0 Severity: Problem
Keywords: memory leak shared_ptr map Cc:

Description

I'm finding that Boost.Serialization is leaking memory when deserialising std::map<std::string,boost::shared_ptr<X>>

I'll attach a short unit test demonstrating this, and the stack trace I get by breaking on the non-free'd memory allocation,using "--detect_memory_leak=800"

I'm using MSCRT, Visual Studio 2008, and boost 1.41.0

I first reported this to the mailing list here: http://lists.boost.org/Archives/boost/2010/01/161190.php

Attachments (2)

BoostSerialisationMemLeak.cpp (2.9 KB ) - added by Richard Bradley <ricbrad@…> 13 years ago.
unit test for Boost.Test which reports memory leaks
BoostSerialisationMemLeak-stacktrace.txt (6.6 KB ) - added by Richard Bradley <ricbrad@…> 13 years ago.
stack trace given when breaking at non-free'd memory allocation

Download all attachments as: .zip

Change History (4)

by Richard Bradley <ricbrad@…>, 13 years ago

unit test for Boost.Test which reports memory leaks

by Richard Bradley <ricbrad@…>, 13 years ago

stack trace given when breaking at non-free'd memory allocation

comment:1 by Richard Bradley <ricbrad@…>, 13 years ago

I have applied the fix recommended here to get boost serialisation to compile: http://lists.boost.org/Archives/boost/2009/11/159098.php

This could have affected things, but the example won't even compile without it.

comment:2 by Robert Ramey, 13 years ago

Resolution: fixed
Status: newclosed

I believe that I've fixed this. Now I don't remember whether or not I've checked in the change. It might have already migrated to trunk or release 1.42 Robert Ramey

Note: See TracTickets for help on using tickets.