From 499331b2078ac4207194e8a416c06a5c81cb6501 Mon Sep 17 00:00:00 2001 From: eap Date: Thu, 19 Aug 2021 17:09:28 +0300 Subject: [PATCH] same fix as in SignCAD() --- src/SMESHUtils/SMESH_MGLicenseKeyGen.cxx | 28 +++++++++++++----------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/src/SMESHUtils/SMESH_MGLicenseKeyGen.cxx b/src/SMESHUtils/SMESH_MGLicenseKeyGen.cxx index a49e74bf8..fa5b78858 100644 --- a/src/SMESHUtils/SMESH_MGLicenseKeyGen.cxx +++ b/src/SMESHUtils/SMESH_MGLicenseKeyGen.cxx @@ -373,7 +373,6 @@ namespace SMESHUtils_MGLicenseKeyGen // API implementation } else { - SMESH_TRY; ok = signFun( meshgems_cad ); @@ -403,6 +402,7 @@ namespace SMESHUtils_MGLicenseKeyGen // API implementation if ( !loadLibrary( error, libraryFile )) return false; + bool ok = false; typedef bool (*SignFun)(void* ); SignFun signFun = (SignFun) GetProc( theLibraryHandle, "SignMesh" ); if ( !signFun ) @@ -410,19 +410,19 @@ namespace SMESHUtils_MGLicenseKeyGen // API implementation if ( ! getLastError( error )) error = SMESH_Comment( "Can't find symbol 'SignMesh' in '") << getenv( theEnvVar ) << "'"; } - bool ok; - - SMESH_TRY; - - ok = signFun( meshgems_mesh ); + else + { + SMESH_TRY; - SMESH_CATCH( SMESH::returnError ); + ok = signFun( meshgems_mesh ); - if ( !error.empty() ) - ok = false; - else if ( !ok ) - error = "SignMesh() failed (located in '" + libraryFile._name + "')"; + SMESH_CATCH( SMESH::returnError ); + if ( !error.empty() ) + ok = false; + else if ( !ok ) + error = "SignMesh() failed (located in '" + libraryFile._name + "')"; + } return ok; } @@ -455,8 +455,10 @@ namespace SMESHUtils_MGLicenseKeyGen // API implementation if ( ! getLastError( error )) error = SMESH_Comment( "Can't find symbol 'GetKey' in '") << getenv( theEnvVar ) << "'"; } - key = keyFun( gmfFile, nbVertex, nbEdge, nbFace, nbVol ); - + else + { + key = keyFun( gmfFile, nbVertex, nbEdge, nbFace, nbVol ); + } if ( key.empty() ) error = "GetKey() failed (located in '" + libraryFile._name + "')"; -- 2.30.2