summaryrefslogtreecommitdiff
path: root/cpp/src
diff options
context:
space:
mode:
authorBenoit Foucher <benoit@zeroc.com>2002-12-16 17:27:57 +0000
committerBenoit Foucher <benoit@zeroc.com>2002-12-16 17:27:57 +0000
commitf771c5b45563c8209d4f2a8ccac69f47a0772fef (patch)
treed36aefba3bf8388a23e471a6c456f181e88cee65 /cpp/src
parentCall deactivate on servant locators outside the OA synchronization block. (diff)
downloadice-f771c5b45563c8209d4f2a8ccac69f47a0772fef.tar.bz2
ice-f771c5b45563c8209d4f2a8ccac69f47a0772fef.tar.xz
ice-f771c5b45563c8209d4f2a8ccac69f47a0772fef.zip
Destroy the instance outside the synchronization block
Diffstat (limited to 'cpp/src')
-rw-r--r--cpp/src/Ice/CommunicatorI.cpp19
1 files changed, 14 insertions, 5 deletions
diff --git a/cpp/src/Ice/CommunicatorI.cpp b/cpp/src/Ice/CommunicatorI.cpp
index dc41f2849f2..db6547e34aa 100644
--- a/cpp/src/Ice/CommunicatorI.cpp
+++ b/cpp/src/Ice/CommunicatorI.cpp
@@ -32,13 +32,22 @@ using namespace IceInternal;
void
Ice::CommunicatorI::destroy()
{
- RecMutex::Lock sync(*this);
+ InstancePtr instance;
- if(!_destroyed) // Don't destroy twice.
{
- _destroyed = true;
- _serverThreadPool = 0;
- _instance->destroy();
+ RecMutex::Lock sync(*this);
+
+ if(!_destroyed) // Don't destroy twice.
+ {
+ _destroyed = true;
+ _serverThreadPool = 0;
+ instance = _instance;
+ }
+ }
+
+ if(instance)
+ {
+ instance->destroy();
}
}