|
Boost Users : |
Subject: Re: [Boost-users] Problem with signals2 and shared_ptr
From: Nat Goodspeed (nat_at_[hidden])
Date: 2010-05-26 11:52:23
Glenn Macgregor wrote:
> I am using boost 1.41.0 on Windows with Visual Studio 2008 and am seeing
> what seems to be an issue with signals2 and shared_ptr. The problem is
> that the shared_ptr does not decrement is reference count after I
> disconnect the signals2::connection.
<snip>
> The
> strange thing is the use_count does not decrement after the disconnect
> or exiting the caller.run function.
>
> Is there a way to force the connection/signal to release that shared_ptr?
This thread may discuss the same issue:
http://old.nabble.com/Re%3A--signals2--review--The-review-of-the-signals2-library-%28formerly-thread_safe_signals%29-begins-today%2C-Nov-1st-p22102367.html
Frank has stated that cleaning up the slot earlier is actually a tricky
problem, because of the necessity to avoid possible race conditions.
Nonetheless I too would be interested in a fix that allows a
disconnected connection involving a bound shared_ptr to destroy the
shared_ptr instance.
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