|
Boost : |
From: Zach Laine (whatwasthataddress_at_[hidden])
Date: 2007-03-23 18:02:56
On 3/23/07, Frank Mori Hess <frank.hess_at_[hidden]> wrote:
> On Friday 23 March 2007 16:57 pm, David Abrahams wrote:
> > on Fri Mar 23 2007, "Zach Laine" <whatwasthataddress-AT-gmail.com> wrote:
> > > + // Test auto-disconnection, part 2
> > > + int value = 0;
> > > + BOOST_CHECK(value == 0);
> > > + {
> > > + short_lived_2 *shorty_2 = new short_lived_2;
> > > + boost::signal0<int> s2;
> > > + s2.connect(boost::bind(&short_lived_2::f, shorty_2));
> > > + delete shorty_2;
> > > + value = s2();
> > > + }
> > > + BOOST_CHECK(value == 0);
> > > +
>
> It looks to me like this test has undefined behaviour? That is, it is
> calling last_value with a non-void return value with no slots connected
> (assuming tracking is working).
Good point. I tried to modify the test so that it throws in
short_lived_2::f() instead, but that seems to work fine. I tried a
standalone test program with 1.33.1, HEAD, and RC_1_34_0_freeze, and
only 1.33.1 seems to show the problem I was trying to demonstrate.
Sorry for the noise.
Zach Laine
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk