Salome HOME
Update views on the module activation
[modules/smesh.git] / src / SMESHGUI / SMESHGUI_HypothesesUtils.cxx
index 7aff8c6ce1b4b281c333e3d19cadf152d9832d07..eaaad911c314d9fc2eda03b7dd3382a9b3215cb9 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2016  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2019  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
@@ -523,15 +523,20 @@ namespace SMESH
         if(MYDEBUG) MESSAGE("Loading client meshers plugin library ...");
 #ifdef WIN32
 #ifdef UNICODE
-               LPTSTR path = new TCHAR[aClientLibName.length() + 1];
-               path[aClientLibName.toWCharArray(path)] = '\0';
+        LPTSTR path = new TCHAR[aClientLibName.length() + 1];
+        path[aClientLibName.toWCharArray(path)] = '\0';
 #else
-               const char* path = aClientLibName.toUtf8().data();
+        QByteArray baPath = aClientLibName.toUtf8();
+        const char* path = baPath.data();
 #endif
 #else
-               char* path = aClientLibName.toUtf8().data();
+        QByteArray baPath = aClientLibName.toUtf8();
+        char* path = baPath.data();
 #endif
         LibHandle libHandle = LoadLib( path );
+#if defined(WIN32) && defined(UNICODE)
+      delete path;
+#endif
         if (!libHandle) {
           // report any error, if occurred
           {
@@ -663,7 +668,7 @@ namespace SMESH
     int res = SMESH::HYP_UNKNOWN_FATAL;
     SUIT_OverrideCursor wc;
 
-    if (!aSubMesh->_is_nil() && ! aHyp->_is_nil()) {
+    if ( !aSubMesh->_is_nil() && !aHyp->_is_nil() ) {
       try {
         SMESH::SMESH_Mesh_var aMesh = aSubMesh->GetFather();
         _PTR(SObject) SsubM = SMESH::FindSObject(aSubMesh);