From 949cdde2ea71eb9c326a7dff6e06656ee0597e1e Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Tue, 29 Oct 2024 11:44:10 +0100 Subject: [PATCH] Remove temporary file generated at /tmp/file.xxxxxx --- src/algorithms/PVT/libs/kml_printer.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/algorithms/PVT/libs/kml_printer.cc b/src/algorithms/PVT/libs/kml_printer.cc index 8a520aec3..6394be27d 100644 --- a/src/algorithms/PVT/libs/kml_printer.cc +++ b/src/algorithms/PVT/libs/kml_printer.cc @@ -319,9 +319,13 @@ Kml_Printer::~Kml_Printer() { std::cerr << e.what() << '\n'; } + errorlib::error_code ec; + if (!fs::remove(fs::path(tmp_file_str), ec)) + { + LOG(INFO) << "Error deleting temporary file"; + } if (!positions_printed) { - errorlib::error_code ec; if (!fs::remove(fs::path(kml_filename), ec)) { LOG(INFO) << "Error deleting temporary KML file";