summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKjell Ahlstedt <kjellahlstedt@gmail.com>2022-05-19 14:05:23 +0200
committerKjell Ahlstedt <kjellahlstedt@gmail.com>2022-05-19 14:05:23 +0200
commit5d8423cd2b05dc3d952abbe790d259699cbbaecf (patch)
tree6df08176aa478e21645170b5b65e16610b7c62f1
parent196625df045cf7202da1b57acb39ee8b5a16a982 (diff)
downloadsigc++-5d8423cd2b05dc3d952abbe790d259699cbbaecf.tar.gz
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
-rw-r--r--sigc++/signal.h6
-rw-r--r--sigc++/signal_base.h5
2 files changed, 11 insertions, 0 deletions
diff --git a/sigc++/signal.h b/sigc++/signal.h
index 8f7dadc..9d6143c 100644
--- a/sigc++/signal.h
+++ b/sigc++/signal.h
@@ -461,6 +461,12 @@ public:
}
/** Creates a functor that calls emit() on this signal.
+ *
+ * @note %sigc::signal does not derive from sigc::trackable in sigc++3.
+ * If you connect the returned functor (calling %emit() on signal1) to
+ * another signal (signal2) and then delete signal1, you must manually
+ * disconnect signal1 from signal2 before you delete signal1.
+ *
* @code
* sigc::mem_fun(mysignal, &sigc::signal_with_accumulator::emit)
* @endcode
diff --git a/sigc++/signal_base.h b/sigc++/signal_base.h
index 3027c69..aa27bc2 100644
--- a/sigc++/signal_base.h
+++ b/sigc++/signal_base.h
@@ -266,6 +266,11 @@ protected:
* @ref sigc::signal_with_accumulator::connect() "sigc::signal::connect()".
*/
+//TODO: When we can break ABI, let signal_base derive from trackable again.
+// It does in sigc++2. Otherwise the slot returned from signal::make_slot()
+// is not automatically disconnected when the signal is deleted.
+// https://github.com/libsigcplusplus/libsigcplusplus/issues/80
+
/** Base class for the @ref sigc::signal<T_return(T_arg...)> "sigc::signal" template.
* %signal_base integrates most of the interface of the derived
* @ref sigc::signal<T_return(T_arg...)> "sigc::signal" template.