From 9821a28e10e99dff1ab1ec109a49ec8390053e29 Mon Sep 17 00:00:00 2001 From: Yimura Date: Fri, 24 Dec 2021 01:58:56 +0100 Subject: [PATCH] fix(Globals): Don't forget to close file handle --- BigBaseV2/src/core/globals.hpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/BigBaseV2/src/core/globals.hpp b/BigBaseV2/src/core/globals.hpp index 12c6db8e..b41064ee 100644 --- a/BigBaseV2/src/core/globals.hpp +++ b/BigBaseV2/src/core/globals.hpp @@ -309,9 +309,13 @@ struct globals { try { file >> this->options; + + file.close(); } catch (const std::exception&) { + file.close(); + LOG(WARNING) << "Detected corrupt settings, writing default config..."; this->write_default_config();