diff options
author | Murray Cumming <murrayc@murrayc.com> | 2016-04-21 17:33:51 +0200 |
---|---|---|
committer | Murray Cumming <murrayc@murrayc.com> | 2016-04-21 17:49:56 +0200 |
commit | 14e413a47bab2ba8e4892f0ba9493c2f8e0265d8 (patch) | |
tree | 488289e38dfe5e52a710294ec355baa7f9d21c86 /sigc++/connection.cc | |
parent | e427deed4c62f73ff28a5f4a7adf4ac713bb3a3a (diff) | |
download | sigc++-14e413a47bab2ba8e4892f0ba9493c2f8e0265d8.tar.gz |
connection: Take the slot_base directly, without the intermediate slot_iterator.
Diffstat (limited to 'sigc++/connection.cc')
-rw-r--r-- | sigc++/connection.cc | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/sigc++/connection.cc b/sigc++/connection.cc index 58c2fe5..bbcfcb7 100644 --- a/sigc++/connection.cc +++ b/sigc++/connection.cc @@ -26,17 +26,19 @@ connection::connection() noexcept : slot_(nullptr) { } -connection::connection(const connection& c) : slot_(c.slot_) +connection::connection(slot_base* slot) +: slot_(slot) { - // Let the connection forget about the signal handler when the handler object dies: if (slot_) slot_->add_destroy_notify_callback(this, ¬ify); } -connection::connection(slot_base& sl) : slot_(&sl) + +connection::connection(const connection& c) : slot_(c.slot_) { // Let the connection forget about the signal handler when the handler object dies: - slot_->add_destroy_notify_callback(this, ¬ify); + if (slot_) + slot_->add_destroy_notify_callback(this, ¬ify); } connection& |