
"Doug Gregor" <dgregor@cs.indiana.edu> wrote in message news:D5FEB638-0DB1-11D9-A949-000D932B7224@cs.indiana.edu...
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