{
MESSAGE("GMSHPlugin_Mesher::Compute");
+ // vuzlov: Environment variables PATH and PYTHONPATH copy and restore
+ // in the end of function because this variables change in gmsh
+ // library and delete paths to libraries of SALOME modules.
+ // See 'gmsh/Common/GmshMessage.cpp::Msg::Initialize' and
+ // 'addGmshPathToEnvironmentVar'
+#ifdef WIN32
+#ifdef UNICODE
+ wchar_t* ws_path = _wgetenv( L"PATH" );
+ wchar_t* wsp_path = _wgetenv( L"PYTHONPATH" );
+#else
+ const char* s_path = getenv("PATH");
+ const char* sp_path = getenv("PYTHONPATH");
+#endif
+#endif
+
int err = 0;
#if GMSH_MAJOR_VERSION >=4 && GMSH_MINOR_VERSION >=8
delete _gModel;
GmshFinalize();
MESSAGE("GMSHPlugin_Mesher::Compute:End");
+
+#ifdef WIN32
+#ifdef UNICODE
+ std::wstring s (L"PATH=");
+ s+=ws_path;
+ _wputenv((wchar_t *)s.c_str());
+ s = L"PYTHONPATH=";
+ s+=wsp_path;
+ _wputenv((wchar_t *)s.c_str());
+#else
+ std::string s("PATH=");
+ s+=s_path;
+ putenv((char *)s.c_str());
+ s = "PYTHONPATH=";
+ s+=sp_path;
+ putenv((char *)s.c_str());
+#endif
+#endif
+
return !err;
}