Subject: Re: [Boost-bugs] [Boost C++ Libraries] #11647: add cleanup expired connections API
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2015-09-14 02:16:31
#11647: add cleanup expired connections API
--------------------------------------+----------------------
Reporter: Lutts Cao <lutts.cao@â¦> | Owner: fmhess
Type: Feature Requests | Status: new
Milestone: To Be Determined | Component: signals2
Version: Boost 1.59.0 | Severity: Problem
Resolution: | Keywords:
--------------------------------------+----------------------
Comment (by Lutts Cao <lutts.cao@â¦>):
Sorry, I just checked I STILL use 1.56 which is installed in my system,
not 1.59.0 which is build my self
Seems you must call some method on signals2::connection or
signals2::signal to cleanup the expired connections, for example, call
connection.connected() or signal.num_slots()
But this implicit behavior is not documented, '''I suggest add some
comment in the document'''
Thanks for your work!
Replying to [comment:1 fmhess]:
> Are you sure you are using 1.59? Because when I run the test program
from your previous ticket against git develop branch (1.59 should behave
similarly), I get the following, which shows the memory getting
deallocated the first time you call connected() after the tracked object
is destroyed.
>
> {{{
> ---TestCase2: check signal2 will prevent memory from being freed---
> allocate 1 objects, object size is 72
> construct TrackObject
> ---TestCase2: after registerHandler: conn.connected: 1
> signal triggered
> destruct TrackObject
> ---TestCase2: should free trackobj here, but not---
> deallocate 1 objects
> ---TestCase2: connected: 0
> ---TestCase2: connected() shows that it's already disconnected
> --TestCase2: so, conn.disconnect() does nothing, the memory is still not
freed
> ---TestCase2: only re-trigger will free memory before this line ---
> }}}
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/11647#comment:2> 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:19 UTC