From: vsr Date: Wed, 14 May 2014 09:43:44 +0000 (+0400) Subject: 0022585: [CEA 1167] option --shutdown-servers kills all salome sessions instead of... X-Git-Tag: V7_4_0rc1~3 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=da7134708b176f6658eb64a01fc4ffb25123fea9;p=modules%2Fkernel.git 0022585: [CEA 1167] option --shutdown-servers kills all salome sessions instead of current session Modify the way the servers are stopped at exit from Python, to correct bug introduced by the fix for issue 22489 --- diff --git a/bin/runSalome.py b/bin/runSalome.py index fa94cbe3e..c819b857c 100755 --- a/bin/runSalome.py +++ b/bin/runSalome.py @@ -725,11 +725,14 @@ def useSalome(args, modules_list, modules_root_dir): import killSalomeWithPort self.killSalomeWithPort = killSalomeWithPort return - def delete(self): + def __del__(self): self.killSalomeWithPort.killMyPort(self.port) return pass - args['shutdown_servers'] = __utils__(args['port']) + def func(s): + del s + import atexit + atexit.register(func, __utils__(args['port'])) pass pass @@ -787,11 +790,6 @@ def no_main(): from searchFreePort import searchFreePort searchFreePort(args, 0) clt = useSalome(args, modules_list, modules_root_dir) - - if args.has_key('shutdown_servers') : - var = args['shutdown_servers'] - if hasattr(var, 'delete') and callable(getattr(var, 'delete')) : - var.delete() return clt # ----------------------------------------------------------------------------- @@ -919,11 +917,6 @@ def runSalome(): if test: foreGround(clt, args) pass - # -- - if args.has_key('shutdown_servers') : - var = args['shutdown_servers'] - if hasattr(var, 'delete') and callable(getattr(var, 'delete')) : - var.delete() pass #