Skip to content

Commit 5d8423c

Browse files
committed
signal::make_slot() docs: Note that signal does not derive from trackable
and therefore the made slot must be manually disconnected if the signal is deleted. See #80
1 parent 196625d commit 5d8423c

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

sigc++/signal.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -461,6 +461,12 @@ class signal_with_accumulator : public signal_base
461461
}
462462

463463
/** Creates a functor that calls emit() on this signal.
464+
*
465+
* @note %sigc::signal does not derive from sigc::trackable in sigc++3.
466+
* If you connect the returned functor (calling %emit() on signal1) to
467+
* another signal (signal2) and then delete signal1, you must manually
468+
* disconnect signal1 from signal2 before you delete signal1.
469+
*
464470
* @code
465471
* sigc::mem_fun(mysignal, &sigc::signal_with_accumulator::emit)
466472
* @endcode

sigc++/signal_base.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,11 @@ struct SIGC_API signal_impl_holder
266266
* @ref sigc::signal_with_accumulator::connect() "sigc::signal::connect()".
267267
*/
268268

269+
//TODO: When we can break ABI, let signal_base derive from trackable again.
270+
// It does in sigc++2. Otherwise the slot returned from signal::make_slot()
271+
// is not automatically disconnected when the signal is deleted.
272+
// https://github.com/libsigcplusplus/libsigcplusplus/issues/80
273+
269274
/** Base class for the @ref sigc::signal<T_return(T_arg...)> "sigc::signal" template.
270275
* %signal_base integrates most of the interface of the derived
271276
* @ref sigc::signal<T_return(T_arg...)> "sigc::signal" template.

0 commit comments

Comments
 (0)