Skip to content

Commit a99835f

Browse files
committed
Fixed deleting pointers
I guess that's how C++ code is done
1 parent 227ef42 commit a99835f

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/ui/Betacraft.cpp

+7-3
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,15 @@ void bc_translate_init() {
3939
languagePath = fallbackLanguagePath;
4040
}
4141

42-
std::ifstream langstream(bc_file_absolute_path(languagePath.c_str()));
42+
const char* languageAbsPath = bc_file_absolute_path(languagePath.c_str());
43+
std::ifstream langstream(languageAbsPath);
4344
languageJson = json::parse(langstream);
4445

45-
std::ifstream fallbacklangstream(bc_file_absolute_path(fallbackLanguagePath.c_str()));
46+
const char* fallbackLanguageAbsPath = bc_file_absolute_path(fallbackLanguagePath.c_str());
47+
std::ifstream fallbacklangstream(fallbackLanguageAbsPath);
4648
fallbackLanguageJson = json::parse(fallbacklangstream);
4749

48-
free(settings);
50+
delete languageAbsPath;
51+
delete fallbackLanguageAbsPath;
52+
delete settings;
4953
}

0 commit comments

Comments
 (0)