From 535033fcd5da351e49d44c51b8bebb592ffe1367 Mon Sep 17 00:00:00 2001 From: vsr Date: Wed, 6 May 2020 16:45:05 +0300 Subject: [PATCH] bos #19060 [CEA] Fatal error no persistant file when loading SMESH --- src/GEOM_I/GEOM_Gen_i.cc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) 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(); } -- 2.39.2