From: eap Date: Thu, 19 Aug 2021 14:09:28 +0000 (+0300) Subject: same fix as in SignCAD() X-Git-Tag: V9_8_0a1~2^2^2~3 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=499331b2078ac4207194e8a416c06a5c81cb6501;p=modules%2Fsmesh.git same fix as in SignCAD() --- 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 + "')";