[sigc] Segfault after calling signal.clear() from signal handler
- From: Andrejs Hanins <andrejs hanins ubnt com>
- To: libsigc-list gnome org
- Subject: [sigc] Segfault after calling signal.clear() from signal handler
- Date: Tue, 4 Jul 2017 15:08:42 +0300
Hi,
My issue might be related to previous posts about "signal_impl::clear()" and maybe even
"sigc::internal::signal_emit1 SIGSEGV".
Namely, the following code fails with segmentation fault:
sigc::signal<void> sig;
sig.connect([&sig]() { sig.clear(); } );
sig();
However it does not fail if handler is disconnected using:
sig = sigc::signal<void>();
or when sigc::connection is used to disconnect the signal/handler linkage.
Worth to note that sigc::slot doesn't have the same problem, it can be safely disconnected from inside
the handler using slot.disconnect().
Is it a bug or some undocumented limitation? It might not be very logical thing to clear all slots
connected to the signal from one of its handlers though. If that is the case, I think at least docs should
tell that.
I reproduced the issue on 2.8.0 and 2.9.3. Didn't try 2.99 yet.
BR, Andrey
[Date Prev][
Date Next] [Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]