From d75f0b0360daeb81dd574756845160745dfecacd Mon Sep 17 00:00:00 2001
From: SmallJoker <mk939@ymail.com>
Date: Sat, 6 Dec 2014 17:26:22 +0100
Subject: [PATCH] Close settings files and save them correctly

---
 src/settings.cpp | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/settings.cpp b/src/settings.cpp
index 775c00699..fa7da806d 100644
--- a/src/settings.cpp
+++ b/src/settings.cpp
@@ -350,8 +350,11 @@ bool Settings::updateConfigFile(const char *filename)
 
 	std::ifstream is(filename);
 	std::ostringstream os(std::ios_base::binary);
-
-	if (!updateConfigObject(is, os, ""))
+	
+	bool was_modified = updateConfigObject(is, os, "");
+	is.close();
+	
+	if (!was_modified)
 		return true;
 
 	if (!fs::safeWriteToFile(filename, os.str())) {
-- 
GitLab