From: vsr Date: Wed, 6 May 2020 13:45:05 +0000 (+0300) Subject: bos #19060 [CEA] Fatal error no persistant file when loading SMESH X-Git-Tag: V9_5_0b1~4 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=535033fcd5da351e49d44c51b8bebb592ffe1367;p=modules%2Fgeom.git bos #19060 [CEA] Fatal error no persistant file when loading SMESH --- diff --git a/src/GEOM_I/GEOM_Gen_i.cc b/src/GEOM_I/GEOM_Gen_i.cc index 0f5af1a72..800f9ec8f 100644 --- a/src/GEOM_I/GEOM_Gen_i.cc +++ b/src/GEOM_I/GEOM_Gen_i.cc @@ -604,12 +604,12 @@ SALOMEDS::TMPFile* GEOM_Gen_i::Save(SALOMEDS::SComponent_ptr theComponent, // Build a full file name of temporary file TCollection_AsciiString aFullName = TCollection_AsciiString((char*)aTmpDir.c_str()) + aNameWithExt; // Save GEOM component in this file - _impl->Save((char*) aFullName.ToCString()); - // Conver a file to the byte stream - aStreamFile = SALOMEDS_Tool::PutFilesToStream(aTmpDir.c_str(), aSeq, isMultiFile); - // Remove the created file and tmp directory - if (!isMultiFile) SALOMEDS_Tool::RemoveTemporaryFiles(aTmpDir.c_str(), aSeq, true); - + if (_impl->Save((char*) aFullName.ToCString())) { + // Convert a file to the byte stream + aStreamFile = SALOMEDS_Tool::PutFilesToStream(aTmpDir.c_str(), aSeq, isMultiFile); + // Remove the created file and tmp directory + if (!isMultiFile) SALOMEDS_Tool::RemoveTemporaryFiles(aTmpDir.c_str(), aSeq, true); + } // Return the created byte stream return aStreamFile._retn(); }