diff options
Diffstat (limited to 'cpp/src/IceGrid/RegistryI.cpp')
-rw-r--r-- | cpp/src/IceGrid/RegistryI.cpp | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/cpp/src/IceGrid/RegistryI.cpp b/cpp/src/IceGrid/RegistryI.cpp index b5c58b51583..088a1c6d8a3 100644 --- a/cpp/src/IceGrid/RegistryI.cpp +++ b/cpp/src/IceGrid/RegistryI.cpp @@ -167,6 +167,25 @@ RegistryI::~RegistryI() bool RegistryI::start() { + try + { + if(!startImpl()) + { + stop(); + return false; + } + } + catch(...) + { + stop(); + throw; + } + return true; +} + +bool +RegistryI::startImpl() +{ assert(_communicator); PropertiesPtr properties = _communicator->getProperties(); @@ -687,7 +706,10 @@ RegistryI::stop() // ensure that there will be no more invocations on IceStorm once // it's shutdown. // - _database->destroyTopics(); + if(_database) + { + _database->destroyTopics(); + } try { |