From e1229a86fc09e34132dbeecf4988ff5482d641c6 Mon Sep 17 00:00:00 2001 From: David Kocik Date: Fri, 10 May 2024 08:37:49 +0200 Subject: [PATCH] Correct mz file closing --- src/slic3r/GUI/PresetArchiveDatabase.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/slic3r/GUI/PresetArchiveDatabase.cpp b/src/slic3r/GUI/PresetArchiveDatabase.cpp index eac57d2890..4c47d0a816 100644 --- a/src/slic3r/GUI/PresetArchiveDatabase.cpp +++ b/src/slic3r/GUI/PresetArchiveDatabase.cpp @@ -43,7 +43,7 @@ bool unzip_repository(const fs::path& source_path, const fs::path& target_path) mz_zip_archive_file_stat file_stat; if (!mz_zip_reader_file_stat(&archive, i, &file_stat)) { BOOST_LOG_TRIVIAL(error) << "Failed to get file stat for file #" << i << " in the zip archive. Ending Unzipping."; - mz_zip_reader_end(&archive); + close_zip_reader(&archive); return false; } fs::path extracted_path = target_path / file_stat.m_filename; @@ -57,11 +57,11 @@ bool unzip_repository(const fs::path& source_path, const fs::path& target_path) // Extract file if (!mz_zip_reader_extract_to_file(&archive, i, extracted_path.string().c_str(), 0)) { BOOST_LOG_TRIVIAL(error) << "Failed to extract file #" << i << " from the zip archive. Ending Unzipping."; - mz_zip_reader_end(&archive); + close_zip_reader(&archive); return false; } } - mz_zip_reader_end(&archive); + close_zip_reader(&archive); return true; }