From a786983e3f11d4ce86ce1687ba44e0d8bfce200d Mon Sep 17 00:00:00 2001 From: Anthony Geay Date: Thu, 9 Sep 2021 08:44:31 +0200 Subject: [PATCH] Fix error on following use case in SSL. Open Shaper - Load a new HDF study file - Switch to GEOM --- src/Basics/KernelBasis.cxx | 11 +++++++++++ src/Basics/KernelBasis.hxx | 2 ++ src/Basics/KernelBasis.i | 3 +++ src/KERNEL_PY/__init__.py | 2 +- 4 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/Basics/KernelBasis.cxx b/src/Basics/KernelBasis.cxx index 73612dc6f..6274ddcec 100644 --- a/src/Basics/KernelBasis.cxx +++ b/src/Basics/KernelBasis.cxx @@ -20,6 +20,7 @@ #include "KernelBasis.hxx" static bool DEFAULT_SSL_MODE = false; +static bool GUI_MODE = false; // IOR of SALOME_Embedded_NamingService servant static std::string IOR_OF_EMBEDDED_NS; @@ -34,6 +35,16 @@ void setSSLMode(bool sslMode) DEFAULT_SSL_MODE = sslMode; } +bool getGUIMode() +{ + return GUI_MODE; +} + +void setGUIMode(bool guiMode) +{ + GUI_MODE = guiMode; +} + std::string BASICS_EXPORT getIOROfEmbeddedNS() { return IOR_OF_EMBEDDED_NS; diff --git a/src/Basics/KernelBasis.hxx b/src/Basics/KernelBasis.hxx index 710106ff3..5b2e5f501 100644 --- a/src/Basics/KernelBasis.hxx +++ b/src/Basics/KernelBasis.hxx @@ -25,6 +25,8 @@ bool BASICS_EXPORT getSSLMode(); void BASICS_EXPORT setSSLMode(bool sslMode); +bool BASICS_EXPORT getGUIMode(); +void BASICS_EXPORT setGUIMode(bool guiMode); std::string BASICS_EXPORT getIOROfEmbeddedNS(); void BASICS_EXPORT setIOROfEmbeddedNS(const std::string& ior); diff --git a/src/Basics/KernelBasis.i b/src/Basics/KernelBasis.i index d2cdbfc13..af7722c58 100644 --- a/src/Basics/KernelBasis.i +++ b/src/Basics/KernelBasis.i @@ -28,5 +28,8 @@ bool getSSLMode(); void setSSLMode(bool sslMode); +bool getGUIMode(); +void setGUIMode(bool guiMode); + std::string getIOROfEmbeddedNS(); void setIOROfEmbeddedNS(const std::string& ior); diff --git a/src/KERNEL_PY/__init__.py b/src/KERNEL_PY/__init__.py index 79dede599..21ae93f65 100644 --- a/src/KERNEL_PY/__init__.py +++ b/src/KERNEL_PY/__init__.py @@ -334,7 +334,7 @@ def salome_close(): salome_study_close() myStudy, myStudyName = None, None import KernelBasis - if KernelBasis.getSSLMode(): + if KernelBasis.getSSLMode() and not KernelBasis.getGUIMode(): import KernelDS KernelDS.KillGlobalSessionInstance() import KernelSDS -- 2.39.2