From abf29c46861da4c81237644342e3399312f96eae Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Thu, 8 Dec 2016 13:33:11 +0100 Subject: 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(). --- sigc++/signal_base.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sigc++') 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. -- cgit v1.2.1