diff options
author | Murray Cumming <murrayc@murrayc.com> | 2015-09-01 14:22:05 +0200 |
---|---|---|
committer | Murray Cumming <murrayc@murrayc.com> | 2015-09-01 14:22:05 +0200 |
commit | e1e977e73f36e5d6572dff00ba1ddf22a3811b42 (patch) | |
tree | abb089bd320ce2afa9b661e32153a16f4f967ac7 | |
parent | 9d897741630f5abe0095ed00f0c1fd8ed08fa685 (diff) | |
download | sigc++-e1e977e73f36e5d6572dff00ba1ddf22a3811b42.tar.gz |
slot_base::operator=(const &): Copy blocked_ too.
So, if we do
a = b;
then a will be blocked if b was blocked. Otherwise it depends on
whether a was blocked, which seems odd.
If this is not the intended behaviour then we need a comment about it
in operator=() and a test.
-rw-r--r-- | sigc++/functors/slot_base.cc | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/sigc++/functors/slot_base.cc b/sigc++/functors/slot_base.cc index d542d7a..4bcfeb7 100644 --- a/sigc++/functors/slot_base.cc +++ b/sigc++/functors/slot_base.cc @@ -138,7 +138,11 @@ slot_base::operator bool() const slot_base& slot_base::operator=(const slot_base& src) { - if (src.rep_ == rep_) return *this; + if (src.rep_ == rep_) + { + blocked_ = src.blocked_; + return *this; + } if (src.empty()) { @@ -161,6 +165,7 @@ slot_base& slot_base::operator=(const slot_base& src) rep_ = nullptr; } } + return *this; } @@ -173,6 +178,7 @@ slot_base& slot_base::operator=(const slot_base& src) } rep_ = new_rep_; + blocked_ = src.blocked_; return *this; } |