diff options
Diffstat (limited to 'cpp/src')
-rw-r--r-- | cpp/src/Ice/CommunicatorI.cpp | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/cpp/src/Ice/CommunicatorI.cpp b/cpp/src/Ice/CommunicatorI.cpp index d52783c6f49..920c3e419f1 100644 --- a/cpp/src/Ice/CommunicatorI.cpp +++ b/cpp/src/Ice/CommunicatorI.cpp @@ -81,11 +81,12 @@ Ice::CommunicatorI::destroy() { RecMutex::Lock sync(*this); - if(!_destroyed) // Don't destroy twice. + if(_destroyed) // Don't destroy twice. { - _destroyed = true; - instance = _instance; + return; } + _destroyed = true; + instance = _instance; } { @@ -96,12 +97,9 @@ Ice::CommunicatorI::destroy() // to be destroyed. // bool last = (--communicatorCount == 0); - if(last && gcInterval > 0) + if(last && gcInterval > 0 && theCollector) { - if(theCollector) - { - theCollector->stop(); - } + theCollector->stop(); } if(theCollector) |