[libsigc++2] slot_base::operator=(const &): Copy blocked_ too.



commit e1e977e73f36e5d6572dff00ba1ddf22a3811b42
Author: Murray Cumming <murrayc murrayc com>
Date:   Tue Sep 1 14:22:05 2015 +0200

    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.

 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;
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]