Boost logo

Boost :

From: Robert Ramey (ramey_at_[hidden])
Date: 2004-05-06 10:27:12


Martin Ecker wrote:

> > Although, I am having problems with my
> > VC71 MFC application reporting memory
> > leaks of a 24byte block corresponding to each shared_ptr loaded from
> > an oarchive.

> I'm not sure, but the memory leaks you experience could possibly be
> related to the fact that basic_iarchive::delete_created_pointers is never
> called. Maybe you can add a call to this function yourself somewhere in
> your application (delete_created_pointers is a public member function of
> basic_iarchive) and see if the memory leaks disappear.

The intended purpose of delete_created_pointers is to delete object created
in the course of de-serializing a stream which has thrown an exception.
Nothing more.

One place you might want to look shared_ptr serialization. Serialization of
shared_ptr starts out by initializing the shared pointer to NULL and adds
references as things proceed. This might be a problem in the case where the
shared_ptr is already pointing to something.

Robert Ramey


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk