diff options
author | Mark Spruiell <mes@zeroc.com> | 2007-08-28 07:16:51 -0700 |
---|---|---|
committer | Mark Spruiell <mes@zeroc.com> | 2007-08-28 07:16:51 -0700 |
commit | e30da0e48de5fad7cc3a92104e751c3a61abb9ce (patch) | |
tree | 3496ebc1b1d5bfa8cff6263a5cd4ff7a5783f327 /py/modules/IcePy/Communicator.cpp | |
parent | Win32 fixes for IceUtil::Timer (diff) | |
download | ice-e30da0e48de5fad7cc3a92104e751c3a61abb9ce.tar.bz2 ice-e30da0e48de5fad7cc3a92104e751c3a61abb9ce.tar.xz ice-e30da0e48de5fad7cc3a92104e751c3a61abb9ce.zip |
fixing exception-handling bug in Ice::initialize if config file is missing
Diffstat (limited to 'py/modules/IcePy/Communicator.cpp')
-rw-r--r-- | py/modules/IcePy/Communicator.cpp | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/py/modules/IcePy/Communicator.cpp b/py/modules/IcePy/Communicator.cpp index e6e5fe50c55..335a9983d12 100644 --- a/py/modules/IcePy/Communicator.cpp +++ b/py/modules/IcePy/Communicator.cpp @@ -161,11 +161,18 @@ communicatorInit(CommunicatorObject* self, PyObject* args, PyObject* /*kwds*/) { data.threadHook = new ThreadNotificationWrapper(threadHook.get()); } + } + try + { + data.properties = Ice::createProperties(seq, data.properties); + } + catch(const Ice::Exception& ex) + { + setPythonException(ex); + return -1; } - data.properties = Ice::createProperties(seq, data.properties); - // // Disable collocation optimization, otherwise a Python invocation on // a collocated servant results in a CollocationOptimizationException @@ -200,7 +207,7 @@ communicatorInit(CommunicatorObject* self, PyObject* args, PyObject* /*kwds*/) } catch(const Ice::Exception& ex) { - for(i = 0; i < argc + 1; ++i) + for(i = 0; i < argc; ++i) { free(argv[i]); } @@ -224,7 +231,7 @@ communicatorInit(CommunicatorObject* self, PyObject* args, PyObject* /*kwds*/) } } - for(i = 0; i < argc + 1; ++i) + for(i = 0; i < argc; ++i) { free(argv[i]); } |