File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -297,6 +297,16 @@ struct temp_slot_list
297
297
* incremented. Both sigc::signal# objects then refer to the same
298
298
* sigc::internal::signal_impl object.
299
299
*
300
+ * Deleting the signal during emission, e.g. from one of its slots, may result
301
+ * in memory leaks. This drawback is fixed in version 3 of libsigc++.
302
+ * A workaround is to make a copy of the signal during the emission:
303
+ * @code
304
+ * sigc::signal<...> sig2(*p_sig);
305
+ * p_sig->emit();
306
+ * @endcode
307
+ * This is not very costly. A sigc::signal<> is not much more than a pointer to
308
+ * a sigc::internal::signal_impl instance, which is not copied.
309
+ *
300
310
* @ingroup signal
301
311
*/
302
312
struct SIGC_API signal_base : public trackable
You can’t perform that action at this time.
0 commit comments