diff options
author | Benoit Foucher <benoit@zeroc.com> | 2017-02-06 12:51:09 +0100 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2017-02-06 12:51:09 +0100 |
commit | eb97ed50f2aa8f94198efccb1fe4d91390d9a334 (patch) | |
tree | 6b20569420b0186a48445c371bafd058b7d817df /cpp | |
parent | ICE-7359 - Fix usage of PyTuple_SET_ITEM (diff) | |
download | ice-eb97ed50f2aa8f94198efccb1fe4d91390d9a334.tar.bz2 ice-eb97ed50f2aa8f94198efccb1fe4d91390d9a334.tar.xz ice-eb97ed50f2aa8f94198efccb1fe4d91390d9a334.zip |
Fixed ICE-7428 - Potential IceGrid node crash on shutdown
Diffstat (limited to 'cpp')
-rw-r--r-- | cpp/src/IceGrid/Activator.cpp | 5 | ||||
-rw-r--r-- | cpp/src/IceGrid/IceGridNode.cpp | 9 |
2 files changed, 7 insertions, 7 deletions
diff --git a/cpp/src/IceGrid/Activator.cpp b/cpp/src/IceGrid/Activator.cpp index ac7f7c3d349..1e4303f439b 100644 --- a/cpp/src/IceGrid/Activator.cpp +++ b/cpp/src/IceGrid/Activator.cpp @@ -1057,6 +1057,11 @@ void Activator::shutdown() { IceUtil::Monitor< IceUtil::Mutex>::Lock sync(*this); + if(_deactivating) + { + return; + } + // // Deactivation has been initiated. Set _deactivating to true to // prevent activation of new processes. This will also cause the diff --git a/cpp/src/IceGrid/IceGridNode.cpp b/cpp/src/IceGrid/IceGridNode.cpp index 2ace825d1ac..c8480146b6e 100644 --- a/cpp/src/IceGrid/IceGridNode.cpp +++ b/cpp/src/IceGrid/IceGridNode.cpp @@ -165,16 +165,12 @@ NodeService::~NodeService() { } - bool NodeService::shutdown() { - assert(_activator); + assert(_activator && _sessions.get()); _activator->shutdown(); - if(_sessions.get()) - { - _sessions->terminate(); // Unblock the main thread if it's blocked on waitForCreate() - } + _sessions->terminate(); // Unblock the main thread if it's blocked on waitForCreate() return true; } @@ -674,7 +670,6 @@ NodeService::stop() { assert(false); } - _activator = 0; } if(_timer) |