Boost logo

Boost :

From: Doug Gregor (dgregor_at_[hidden])
Date: 2004-09-23 22:44:06

On Sep 23, 2004, at 10:28 PM, Dave Deakins wrote:
> "Doug Gregor" <dgregor_at_[hidden]> wrote in message
>> On Sep 5, 2004, at 5:51 PM, Dave Deakins wrote:
>>> ...should there be a:
>>> watch_bound_objects.set_controlling();
>>> statement at the very end of the slot_base::create_connection()
>>> procedure
>>> (after the safe_connection.release() statement) in slot.cpp?
>> I don't think that's the right solution, because watch_bound_objects
>> gets copied around a bit, and would then disconnect too early. I'm
>> revisiting this code now to try to isolate the bug.
> I agree. After trying out that idea, I noticed exactly what you said.
> It
> did indeed cause slots to disconnect prematurely. However, what if
> you made
> watch_bound_objects a shared_ptr<connection> instead of a just a
> connection?
> In that case, you could still set it as controlling at the end of
> create_connection, but the connection wouldn't be destroyed unless all
> copies of the slot ceased to exist. It seems like that would work to
> clean
> up the slot/trackable references at the proper time, but maybe there
> is a
> more elegant solution than that.
> -Dave

I'm sure there's a more elegant solution, but I'm a bit afraid to rock
the boat with Aleksey trying to roll a release :) I'm going to give
myself the evening to see if I can think up any problems with this
solution, and will try to implement it within the next day or so.
Thanks for your help! Let's hope this thing cleans up nicely :)


Boost list run by bdawes at, gregod at, cpdaniel at, john at