mirror of
https://github.com/clangen/musikcube.git
synced 2025-02-21 03:41:10 +00:00
resolved file buffer and log window memory leaks
This commit is contained in:
parent
46752e64a5
commit
5559000db5
@ -55,9 +55,11 @@ static nlohmann::json loadLocaleData(const std::string& fn) {
|
||||
char* bytes = nullptr;
|
||||
int count = 0;
|
||||
|
||||
if (FileToByteArray(fn, &bytes, count, true)) {
|
||||
if (FileToByteArray(fn, &bytes, count, true) == true) {
|
||||
try {
|
||||
return nlohmann::json::parse(bytes);
|
||||
nlohmann::json localeData = nlohmann::json::parse(bytes);
|
||||
free(bytes);
|
||||
return localeData;
|
||||
}
|
||||
catch (...) {
|
||||
}
|
||||
@ -180,4 +182,4 @@ int Locale::Dimension(const char* key, int defaultValue) {
|
||||
}
|
||||
|
||||
return defaultValue; /* not found anywhere */
|
||||
}
|
||||
}
|
||||
|
@ -59,6 +59,9 @@ LogWindow::LogWindow(IWindow *parent)
|
||||
}
|
||||
|
||||
LogWindow::~LogWindow() {
|
||||
if (this->adapter != nullptr) {
|
||||
delete this->adapter;
|
||||
}
|
||||
}
|
||||
|
||||
IScrollAdapter& LogWindow::GetScrollAdapter() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user