mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-21 10:23:41 +00:00
Fix cleanup of temp files in case of failed initialization
This commit is contained in:
@@ -688,6 +688,7 @@ int main(int argc, char** argv) {
|
|||||||
|
|
||||||
if (!init_input_file(IfcUtil::path::to_utf8(input_filename), ifc_file, no_progress || quiet, mmap)) {
|
if (!init_input_file(IfcUtil::path::to_utf8(input_filename), ifc_file, no_progress || quiet, mmap)) {
|
||||||
write_log(!quiet);
|
write_log(!quiet);
|
||||||
|
serializer.reset();
|
||||||
IfcUtil::path::delete_file(IfcUtil::path::to_utf8(output_temp_filename)); /**< @todo Windows Unicode support */
|
IfcUtil::path::delete_file(IfcUtil::path::to_utf8(output_temp_filename)); /**< @todo Windows Unicode support */
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
@@ -697,6 +698,7 @@ int main(int argc, char** argv) {
|
|||||||
/// @todo It would be nice to know and print separate error prints for a case where we found no entities
|
/// @todo It would be nice to know and print separate error prints for a case where we found no entities
|
||||||
/// and for a case we found no entities that satisfy our filtering criteria.
|
/// and for a case we found no entities that satisfy our filtering criteria.
|
||||||
Logger::Error("No geometrical entities found");
|
Logger::Error("No geometrical entities found");
|
||||||
|
serializer.reset();
|
||||||
IfcUtil::path::delete_file(IfcUtil::path::to_utf8(output_temp_filename));
|
IfcUtil::path::delete_file(IfcUtil::path::to_utf8(output_temp_filename));
|
||||||
write_log(!quiet);
|
write_log(!quiet);
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
|
|||||||
Reference in New Issue
Block a user