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 /api/logic/meta/BaseEntity.cpp | |
parent | a0ef20a264656c127dd62eb9140e89a2fda6a8e0 (diff) | |
download | PrismLauncher-cd57e354feb0f01369bc35f6c48f9b893786880d.tar.gz PrismLauncher-cd57e354feb0f01369bc35f6c48f9b893786880d.tar.bz2 PrismLauncher-cd57e354feb0f01369bc35f6c48f9b893786880d.zip |
NOISSUE fix a bunch of valgrind errors
Diffstat (limited to 'api/logic/meta/BaseEntity.cpp')
-rw-r--r-- | api/logic/meta/BaseEntity.cpp | 8 |
1 files changed, 6 insertions, 2 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) |