Skip to content

Commit abf29c4

Browse files
author
Kjell Ahlstedt
committed
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().
1 parent 9cdd560 commit abf29c4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sigc++/signal_base.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ signal_impl::clear()
6565
// Don't let signal_impl::notify() erase the slots. It would invalidate the
6666
// iterator in the following loop.
6767
const bool saved_deferred = deferred_;
68-
signal_impl_exec_holder(this);
68+
signal_impl_exec_holder exec(this);
6969

7070
// Disconnect all connected slots before they are deleted.
7171
// signal_impl::notify() will be called and delete the self_and_iter structs.

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy