summaryrefslogtreecommitdiff
path: root/cpp/src/Ice/CommunicatorI.cpp
diff options
context:
space:
mode:
authorBernard Normier <bernard@zeroc.com>2009-01-23 17:07:21 -0500
committerBernard Normier <bernard@zeroc.com>2009-01-23 17:07:21 -0500
commit2380e089401d048490da23bc6d71e5687bafbe47 (patch)
tree6d97052d1f93bc2bafcd7fd1a9ebe103544b6cad /cpp/src/Ice/CommunicatorI.cpp
parentFixed permissions (diff)
parent3.3.1 third-party updates (diff)
downloadice-2380e089401d048490da23bc6d71e5687bafbe47.tar.bz2
ice-2380e089401d048490da23bc6d71e5687bafbe47.tar.xz
ice-2380e089401d048490da23bc6d71e5687bafbe47.zip
Merge branch 'R3_3_branch' of cvs:/home/git/ice into R3_3_branch
Conflicts: java/resources/IceGridAdmin/icegridadmin_content_dyn.html java/resources/IceGridAdmin/icegridadmin_content_static.html
Diffstat (limited to 'cpp/src/Ice/CommunicatorI.cpp')
-rw-r--r--cpp/src/Ice/CommunicatorI.cpp30
1 files changed, 17 insertions, 13 deletions
diff --git a/cpp/src/Ice/CommunicatorI.cpp b/cpp/src/Ice/CommunicatorI.cpp
index 6aa367775e0..609926aa1df 100644
--- a/cpp/src/Ice/CommunicatorI.cpp
+++ b/cpp/src/Ice/CommunicatorI.cpp
@@ -1,6 +1,6 @@
// **********************************************************************
//
-// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved.
+// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved.
//
// This copy of Ice is licensed to you under the terms described in the
// ICE_LICENSE file included in this distribution.
@@ -71,7 +71,7 @@ printGCStats(const IceInternal::GCStats& stats)
void
Ice::CommunicatorI::destroy()
{
- if(_instance->destroy())
+ if(_instance && _instance->destroy())
{
IceUtil::StaticMutex::Lock sync(gcMutex);
@@ -289,15 +289,7 @@ Ice::CommunicatorI::CommunicatorI(const InitializationData& initData)
// destructor is invoked.
//
const_cast<DynamicLibraryListPtr&>(_dynamicLibraryList) = _instance->dynamicLibraryList();
- }
- catch(...)
- {
- __setNoDelete(false);
- throw;
- }
- __setNoDelete(false);
- {
//
// If this is the first communicator that is created, use that communicator's
// property settings to determine whether to start the garbage collector.
@@ -316,13 +308,25 @@ Ice::CommunicatorI::CommunicatorI(const InitializationData& initData)
}
if(++communicatorCount == 1)
{
- theCollector = new IceInternal::GC(gcInterval, printGCStats);
+ IceUtil::Handle<IceInternal::GC> collector = new IceInternal::GC(gcInterval, printGCStats);
if(gcInterval > 0)
{
- theCollector->start();
+ collector->start();
}
+
+ //
+ // Assign only if start() succeeds, if it fails this makes sure stop isn't called in destroy().
+ //
+ theCollector = collector;
}
}
+ catch(...)
+ {
+ destroy();
+ __setNoDelete(false);
+ throw;
+ }
+ __setNoDelete(false);
}
Ice::CommunicatorI::~CommunicatorI()
@@ -343,7 +347,7 @@ Ice::CommunicatorI::finishSetup(int& argc, char* argv[])
}
catch(...)
{
- _instance->destroy();
+ destroy();
throw;
}
}