diff options
Diffstat (limited to 'ace/Monitor_Control_Types.cpp')
-rw-r--r-- | ace/Monitor_Control_Types.cpp | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/ace/Monitor_Control_Types.cpp b/ace/Monitor_Control_Types.cpp index c91056c067a..a1bf3399c2b 100644 --- a/ace/Monitor_Control_Types.cpp +++ b/ace/Monitor_Control_Types.cpp @@ -53,17 +53,20 @@ namespace ACE Monitor_Control_Types::Constraint& Monitor_Control_Types::Constraint::operator= (const Constraint& rhs) { - if (this->control_action != 0) - { - this->control_action->remove_ref (); - } - - this->expr = rhs.expr; - this->control_action = rhs.control_action; - - if (this->control_action != 0) + if (this != &rhs) { - this->control_action->add_ref (); + if (this->control_action != 0) + { + this->control_action->remove_ref (); + } + + this->expr = rhs.expr; + this->control_action = rhs.control_action; + + if (this->control_action != 0) + { + this->control_action->add_ref (); + } } return *this; |