]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
0022585: [CEA 1167] option --shutdown-servers kills all salome sessions instead of...
authorvsr <vsr@opencascade.com>
Wed, 14 May 2014 09:43:44 +0000 (13:43 +0400)
committervsr <vsr@opencascade.com>
Wed, 14 May 2014 09:43:44 +0000 (13:43 +0400)
Modify the way the servers are stopped at exit from Python, to correct bug introduced by the fix for issue 22489

bin/runSalome.py

index fa94cbe3ed21599f9e4c390edb64fc0e1e049304..c819b857c8513c044d2a650d8e4e63e69cbf26d6 100755 (executable)
@@ -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
 #