[glibmm] connection_add_exception_handler(): Use list<slot> instead of signal.
- From: Murray Cumming <murrayc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glibmm] connection_add_exception_handler(): Use list<slot> instead of signal.
- Date: Tue, 5 Jul 2016 07:39:50 +0000 (UTC)
commit 59db6a2dcf7344ad2a21927535c2cd9a865267cd
Author: Murray Cumming <murrayc murrayc com>
Date: Fri Apr 22 09:51:22 2016 +0200
connection_add_exception_handler(): Use list<slot> instead of signal.
Because libsigc++ 2.10 deprecates signal::slots() and libsigc++ 3.0
now has no signal<>::slots() method. Using a signal for the list of
slots seems rather non-obvious anyway.
glib/glibmm/exceptionhandler.cc | 13 +++++++------
1 files changed, 7 insertions(+), 6 deletions(-)
---
diff --git a/glib/glibmm/exceptionhandler.cc b/glib/glibmm/exceptionhandler.cc
index 31ddb39..95032a3 100644
--- a/glib/glibmm/exceptionhandler.cc
+++ b/glib/glibmm/exceptionhandler.cc
@@ -32,7 +32,7 @@
namespace
{
-using HandlerList = sigc::signal<void>;
+using HandlerList = std::list<sigc::slot<void()>>;
// Each thread has its own list of exception handlers
// to avoid thread synchronization problems.
@@ -108,8 +108,9 @@ add_exception_handler(const sigc::slot<void>& slot)
#endif
}
- handler_list->slots().push_front(slot);
- return handler_list->slots().begin();
+ handler_list->emplace_back(slot);
+ auto& added_slot = handler_list->back();
+ return sigc::connection(added_slot);
}
// internal
@@ -135,15 +136,15 @@ exception_handlers_invoke() noexcept
if(HandlerList *const handler_list = thread_specific_handler_list.get())
#endif
{
- HandlerList::iterator pslot = handler_list->slots().begin();
+ HandlerList::iterator pslot = handler_list->begin();
- while (pslot != handler_list->slots().end())
+ while (pslot != handler_list->end())
{
// Calling an empty slot would mean ignoring the exception,
// thus we have to check for dead slots explicitly.
if (pslot->empty())
{
- pslot = handler_list->slots().erase(pslot);
+ pslot = handler_list->erase(pslot);
continue;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]