summaryrefslogtreecommitdiff
path: root/py
diff options
context:
space:
mode:
authorJose <jose@zeroc.com>2014-12-11 22:14:37 +0100
committerJose <jose@zeroc.com>2014-12-11 22:14:37 +0100
commitbbc8d98df9498ae2b0546c25d0f1e5f5fdb22c40 (patch)
treee22818cc6b14c3eb6aa09e2fbe5b288d862ec995 /py
parentFixed (ICE-6103) - Java IceGrid/simple failure on Win7 x64 no VC (diff)
downloadice-bbc8d98df9498ae2b0546c25d0f1e5f5fdb22c40.tar.bz2
ice-bbc8d98df9498ae2b0546c25d0f1e5f5fdb22c40.tar.xz
ice-bbc8d98df9498ae2b0546c25d0f1e5f5fdb22c40.zip
Fixed (ICE-6160) - Python Glacier2 Application always leaks a communicator
Diffstat (limited to 'py')
-rw-r--r--py/python/Ice.py38
1 files changed, 20 insertions, 18 deletions
diff --git a/py/python/Ice.py b/py/python/Ice.py
index 9531ab04bb2..5eb036b9e66 100644
--- a/py/python/Ice.py
+++ b/py/python/Ice.py
@@ -1117,18 +1117,14 @@ value is an integer representing the exit status.
Application._ctrlCHandler = CtrlCHandler()
try:
- status = 0
-
Application._interrupted = False
Application._appName = initData.properties.getPropertyWithDefault("Ice.ProgramName", args[0])
Application._application = self
- Application._communicator = initialize(args, initData)
- Application._destroyed = False
#
# Used by _destroyOnInterruptCallback and _shutdownOnInterruptCallback.
#
- Application._nohup = Application._communicator.getProperties().getPropertyAsInt("Ice.Nohup") > 0
+ Application._nohup = initData.properties.getPropertyAsInt("Ice.Nohup") > 0
#
# The default is to destroy when a signal is received.
@@ -1140,7 +1136,25 @@ value is an integer representing the exit status.
except:
getProcessLogger().error(traceback.format_exc())
status = 1
+ #
+ # Set _ctrlCHandler to 0 only once communicator.destroy() has
+ # completed.
+ #
+ Application._ctrlCHandler.destroy()
+ Application._ctrlCHandler = None
+
+ return status
+
+ def doMain(self, args, initData):
+ try:
+ Application._communicator = initialize(args, initData)
+ Application._destroyed = False
+ status = self.run(args)
+ except:
+ getProcessLogger().error(traceback.format_exc())
+ status = 1
+
#
# Don't want any new interrupt and at this point (post-run),
# it would not make sense to release a held signal to run
@@ -1170,21 +1184,9 @@ value is an integer representing the exit status.
except:
getProcessLogger().error(traceback.format_exc())
status = 1
-
- Application._communicator = None
-
- #
- # Set _ctrlCHandler to 0 only once communicator.destroy() has
- # completed.
- #
- Application._ctrlCHandler.destroy()
- Application._ctrlCHandler = None
-
+ Application._communicator = None
return status
- def doMain(self, args, initData):
- return self.run(args)
-
def run(self, args):
'''This method must be overridden in a subclass. The base
class supplies an argument list from which all Ice arguments