From 8b8b4241036975c907a537d208bac1ab1c945d77 Mon Sep 17 00:00:00 2001 From: rnv Date: Thu, 27 Sep 2018 14:34:01 +0300 Subject: [PATCH] Some corrections related to using UNICODE. --- src/MEDWrapper/MED_Factory.cxx | 6 +++++- src/SMESHGUI/SMESHGUI_HypothesesUtils.cxx | 3 +++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/MEDWrapper/MED_Factory.cxx b/src/MEDWrapper/MED_Factory.cxx index dbe60c051..3e354c131 100644 --- a/src/MEDWrapper/MED_Factory.cxx +++ b/src/MEDWrapper/MED_Factory.cxx @@ -55,7 +55,11 @@ namespace MED #else cosnt char* path = xmlPath.c_str(); #endif - return (GetFileAttributes(path) != INVALID_FILE_ATTRIBUTES); + bool res = (GetFileAttributes(path) != INVALID_FILE_ATTRIBUTES); +#ifdef UNICODE + delete path; +#endif + return res; #else return (access(fileName.c_str(), F_OK) == 0); #endif diff --git a/src/SMESHGUI/SMESHGUI_HypothesesUtils.cxx b/src/SMESHGUI/SMESHGUI_HypothesesUtils.cxx index 255d2f575..42847411b 100644 --- a/src/SMESHGUI/SMESHGUI_HypothesesUtils.cxx +++ b/src/SMESHGUI/SMESHGUI_HypothesesUtils.cxx @@ -534,6 +534,9 @@ namespace SMESH char* path = baPath.data(); #endif LibHandle libHandle = LoadLib( path ); +#if defined(WIN32) && defined(UNICODE) + delete path; +#endif if (!libHandle) { // report any error, if occurred { -- 2.39.2