Salome HOME
SALOME 9.1.0 Windows version
[modules/smesh.git] / src / SMESH_I / SMESH_Gen_i.cxx
index e6ebe05e91a43b03b87159ff1fbf7cdd2afd3ffd..e7916cca304537d9ee411eec722e7088e0d593a2 100644 (file)
@@ -439,7 +439,19 @@ GenericHypothesisCreator_i* SMESH_Gen_i::getHypothesisCreator(const char* theHyp
     {
       // load plugin library
       if(MYDEBUG) MESSAGE("Loading server meshers plugin library ...");
-      LibHandle libHandle = LoadLib( aPlatformLibName.c_str() );
+#ifdef WIN32
+#ifdef UNICODE
+         const wchar_t* path = Kernel_Utils::decode_s(aPlatformLibName);
+#else
+         const char* path = aPlatformLibName.c_str()
+#endif
+#else
+         const char* path = aPlatformLibName.c_str()
+#endif
+      LibHandle libHandle = LoadLib( path );
+#if defined(WIN32) && defined(UNICODE)
+         delete path;
+#endif
       if (!libHandle)
       {
         // report any error, if occurred
@@ -4965,8 +4977,7 @@ void SMESH_Gen_i::Close( SALOMEDS::SComponent_ptr theComponent )
   if(MYDEBUG) MESSAGE( "SMESH_Gen_i::Close" );
 
   // Clear study contexts data
-  delete myStudyContext;
-  myStudyContext = 0;
+  myStudyContext->Clear();
 
   // remove the tmp files meshes are loaded from
   SMESH_PreMeshInfo::RemoveStudyFiles_TMP_METHOD( theComponent );