|
Boost : |
From: Jeff Flinn (TriumphSprint2000_at_[hidden])
Date: 2004-05-05 10:28:25
<martin.ecker_at_[hidden]> wrote in message
news:OFA3E70668.F858C3FC-ONC1256E8B.00350F65-C1256E8B.00355AB5_at_tab.at...
> Robert,
>
[snip]
>
> While on the topic, the current shared_ptr serialization code gives
> an access violation when deserializing an empty shared_ptr.
> To remedy this in the class shared_ptr_access the following code
> static void add_ref_copy(boost::detail::sp_counted_base * t){
> t->add_ref_copy();
> };
>
> should be changed to check for a non-NULL pointer to the counter:
> static void add_ref_copy(boost::detail::sp_counted_base * t){
> if (t)
> t->add_ref_copy();
> };
>
Thanks this cleared up the access violation that I had reported in
http://article.gmane.org/gmane.comp.lib.boost.devel/36786/match=
The example in that email now runs properly.
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. The same result for binary, text and xml. Of course this problem
is not reproducible in the example from the email link above. I'm also not
sure at this point whether these are true leaks, or simply a manifestation
of the VC memory tracker being confused.
Jeff F
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk