summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKjell Ahlstedt <kjell.ahlstedt@bredband.net>2016-12-08 13:33:11 +0100
committerKjell Ahlstedt <kjell.ahlstedt@bredband.net>2016-12-08 13:33:11 +0100
commitabf29c46861da4c81237644342e3399312f96eae (patch)
treeedb951462fdb5cccfa0238061d9f80b1f610576e
parent9cdd56082174900f6bf1656fa29eedabbfed8f87 (diff)
downloadsigc++-abf29c46861da4c81237644342e3399312f96eae.tar.gz
signal_impl::clear(): Really avoid erasing the slots prematurely
The call signal_impl_exec_holder(this) creates a signal_impl_exec_holder which is immediately destroyed. It does not stop signal_impl::notify() from erasing the slots. Create a signal_impl_exec_holder that exists until the end of clear().
-rw-r--r--sigc++/signal_base.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/sigc++/signal_base.cc b/sigc++/signal_base.cc
index 8081b2e..a3dabdc 100644
--- a/sigc++/signal_base.cc
+++ b/sigc++/signal_base.cc
@@ -65,7 +65,7 @@ signal_impl::clear()
// Don't let signal_impl::notify() erase the slots. It would invalidate the
// iterator in the following loop.
const bool saved_deferred = deferred_;
- signal_impl_exec_holder(this);
+ signal_impl_exec_holder exec(this);
// Disconnect all connected slots before they are deleted.
// signal_impl::notify() will be called and delete the self_and_iter structs.