Salome HOME
0022712: [CEA 1300] LightApp_PreferencesDlg - invalid layout / resize policy
[modules/gui.git] / src / Session / SALOME_Session_Server.cxx
index 65284c93d644cf0f2b84c1f852b844b010d9e782..4d34b5e5822f4c08160cc49bb2b8ca8d13929900 100755 (executable)
@@ -653,9 +653,11 @@ int main( int argc, char **argv )
     init->explicit_destroy();
 
   // After ORB destruction
-  PyGILState_Ensure();
   if(Py_IsInitialized())
-    Py_Finalize();
+    {
+      PyGILState_Ensure();
+      Py_Finalize();
+    }
 
   if ( shutdownAll )
     killOmniNames();