diff options
author | Petr Mrázek <peterix@gmail.com> | 2020-06-28 13:25:53 +0200 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2020-06-28 13:25:53 +0200 |
commit | cd57e354feb0f01369bc35f6c48f9b893786880d (patch) | |
tree | 180b5c0665fb583c89faba9495176f806d89d4da | |
parent | a0ef20a264656c127dd62eb9140e89a2fda6a8e0 (diff) | |
download | MultiMC-cd57e354feb0f01369bc35f6c48f9b893786880d.tar MultiMC-cd57e354feb0f01369bc35f6c48f9b893786880d.tar.gz MultiMC-cd57e354feb0f01369bc35f6c48f9b893786880d.tar.lz MultiMC-cd57e354feb0f01369bc35f6c48f9b893786880d.tar.xz MultiMC-cd57e354feb0f01369bc35f6c48f9b893786880d.zip |
NOISSUE fix a bunch of valgrind errors
-rw-r--r-- | api/logic/meta/BaseEntity.cpp | 8 | ||||
-rw-r--r-- | api/logic/minecraft/PackProfile_p.h | 1 | ||||
-rw-r--r-- | api/logic/translations/TranslationsModel.cpp | 3 |
3 files changed, 8 insertions, 4 deletions
diff --git a/api/logic/meta/BaseEntity.cpp b/api/logic/meta/BaseEntity.cpp index ce0be859..697beb56 100644 --- a/api/logic/meta/BaseEntity.cpp +++ b/api/logic/meta/BaseEntity.cpp @@ -53,7 +53,9 @@ public: /* methods */ auto fname = m_entity->localFilename(); try { - m_entity->parse(Json::requireObject(Json::requireDocument(data, fname), fname)); + auto doc = Json::requireDocument(data, fname); + auto obj = Json::requireObject(doc, fname); + m_entity->parse(obj); return true; } catch (const Exception &e) @@ -87,7 +89,9 @@ bool Meta::BaseEntity::loadLocalFile() // TODO: check if the file has the expected checksum try { - parse(Json::requireObject(Json::requireDocument(fname, fname), fname)); + auto doc = Json::requireDocument(fname, fname); + auto obj = Json::requireObject(doc, fname); + parse(obj); return true; } catch (const Exception &e) diff --git a/api/logic/minecraft/PackProfile_p.h b/api/logic/minecraft/PackProfile_p.h index 2f7cc3d7..6cd2a4e5 100644 --- a/api/logic/minecraft/PackProfile_p.h +++ b/api/logic/minecraft/PackProfile_p.h @@ -9,7 +9,6 @@ class MinecraftInstance; using ComponentContainer = QList<ComponentPtr>; using ComponentIndex = QMap<QString, ComponentPtr>; -using ConnectionList = QList<QMetaObject::Connection>; struct PackProfileData { diff --git a/api/logic/translations/TranslationsModel.cpp b/api/logic/translations/TranslationsModel.cpp index a5a4fb15..43b3e75f 100644 --- a/api/logic/translations/TranslationsModel.cpp +++ b/api/logic/translations/TranslationsModel.cpp @@ -184,7 +184,8 @@ void readIndex(const QString & path, QMap<QString, Language>& languages) int index = 1; try { - auto doc = Json::requireObject(Json::requireDocument(data)); + auto toplevel_doc = Json::requireDocument(data); + auto doc = Json::requireObject(toplevel_doc); auto file_type = Json::requireString(doc, "file_type"); if(file_type != "MMC-TRANSLATION-INDEX") { |