Subject: Re: [Boost-bugs] [Boost C++ Libraries] #10100: [signals2] trackable fails to disconnect slot on deletion
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2014-06-09 00:00:45
#10100: [signals2] trackable fails to disconnect slot on deletion
-------------------------------+----------------------
Reporter: wim@⦠| Owner: fmhess
Type: Bugs | Status: new
Milestone: To Be Determined | Component: signals2
Version: Boost 1.55.0 | Severity: Problem
Resolution: | Keywords:
-------------------------------+----------------------
Comment (by fmhess):
Replying to [ticket:10100 wim@â¦]:
> I ran into a situation where boost.signals correctly tracks the lifetime
of an object, whereas boost.signals2 fails to track the lifetime of the
object.
>
> My best guess is that there is probably a shared_ptr somewhere in the
stack trace of the 'fooer' slot invocation that can be replace by a
weak_ptr. The assumption is that that shared_ptr keeps the connection
alive while it should die.
The signal invocation keeps a shared_ptr alive for each tracked object,
for the duration of the invocation. It's meant to prevent the tracked
objects from being destroyed mid-invocation. In order to make the
behavior of signals2::trackable more compatible with the original signals
library, I'll have to make its destructor explicitly disconnect, rather
than just destroying a tracked shared_ptr.
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/10100#comment:1> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:16 UTC