diff options
author | Benoit Foucher <benoit@zeroc.com> | 2012-10-26 18:02:49 +0200 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2012-10-26 18:02:49 +0200 |
commit | da840df6a47591d7816e977c7c030f7330a2f098 (patch) | |
tree | 88da6faf9424e42a5e8258a4c6969d741914efa5 /cpp/src | |
parent | Minor metrics fixes (diff) | |
download | ice-da840df6a47591d7816e977c7c030f7330a2f098.tar.bz2 ice-da840df6a47591d7816e977c7c030f7330a2f098.tar.xz ice-da840df6a47591d7816e977c7c030f7330a2f098.zip |
Fixed cross test failure, memory leaks and UMRs
Diffstat (limited to 'cpp/src')
-rw-r--r-- | cpp/src/Ice/GC.cpp | 6 | ||||
-rw-r--r-- | cpp/src/Ice/Instance.cpp | 5 |
2 files changed, 10 insertions, 1 deletions
diff --git a/cpp/src/Ice/GC.cpp b/cpp/src/Ice/GC.cpp index 83144936458..daf08851e72 100644 --- a/cpp/src/Ice/GC.cpp +++ b/cpp/src/Ice/GC.cpp @@ -389,7 +389,11 @@ void IceInternal::GC::updateObserver(const CommunicatorObserverPtr& observer) { Monitor<Mutex>::Lock sync(*this); - assert(observer); + if(!observer) + { + assert(!_communicatorObserver); // Communicator is destroyed. + return; + } // Only the first communicator can observe the GC thread. if(!_communicatorObserver) diff --git a/cpp/src/Ice/Instance.cpp b/cpp/src/Ice/Instance.cpp index dca161e3aeb..9b17a5ecf43 100644 --- a/cpp/src/Ice/Instance.cpp +++ b/cpp/src/Ice/Instance.cpp @@ -1375,6 +1375,11 @@ IceInternal::Instance::destroy() if(_metricsAdmin) { _metricsAdmin->destroy(); + _metricsAdmin = 0; + if(CommunicatorObserverIPtr::dynamicCast(_initData.observer)) + { + _initData.observer = 0; // Clear cyclic reference counts. + } } ThreadPoolPtr serverThreadPool; |