diff options
author | Michi Henning <michi@zeroc.com> | 2003-12-30 04:19:58 +0000 |
---|---|---|
committer | Michi Henning <michi@zeroc.com> | 2003-12-30 04:19:58 +0000 |
commit | e18d51c13d84d53321ff473e9772f66ea19fc5e3 (patch) | |
tree | 98afecaceb2adac966d1a7ff36d93375e5715980 /cpp/src | |
parent | Iterator fixes (diff) | |
download | ice-e18d51c13d84d53321ff473e9772f66ea19fc5e3.tar.bz2 ice-e18d51c13d84d53321ff473e9772f66ea19fc5e3.tar.xz ice-e18d51c13d84d53321ff473e9772f66ea19fc5e3.zip |
Fixed bug in Communicator::destroy(): if the same communicator was
destroyed more than once, the communicator count could become negative.
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) |