Boost logo

Boost Users :

From: Jeff Flinn (TriumphSprint2000_at_[hidden])
Date: 2005-08-15 16:53:52


"Thorsten Ottosen" <nesotto_at_[hidden]> wrote in message
news:ddqti0$jkh$1_at_sea.gmane.org...
>
> "Robert Ramey" <ramey_at_[hidden]> wrote in message
> news:ddqq76$9ng$1_at_sea.gmane.org...
>> > If that is true then why do they pass the test???
>> >
>> >
> (http://engineering.meta-comm.com/boost-regression/CVS-RC_1_33_0/user/smart_
>> > ptr_release.html)
>> >
>>
>> a) I don't see any tests of scoped_ptr there.
>
> it is part of smart_ptr_test.cpp.
>
>> b) If I recall correctly, the borland version of scoped_ptr fails when
>> the
>> type is incomplete - which makes it not useful for implementing the PIMPL
>> idiom.
>
> it always fails unless the destructor is included first in the cpp file
> IIRC.
>
>> c) I was reluctant to include the whole smart_ptr machinery for just this
>> one case.
>
> ok.
>
>> I am surprised that the delete in the destructor fails to delete the
> pimpl.
>> I've been unable to find the place where a constructor throws.
>
> ok ... maybe the hypothesis can be checked by Jeff on a compiler
> where scoped_ptr does work?

The following change in xml_iarchive.hpp(along with removing the matching
delete in the corresponding .ipp file) fixes the leaks:

    scoped_ptr<xml_grammar> gimpl;
    // xml_grammar *gimpl;

Jeff Flinn


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net