From a8f67ace8ed42dcecca7d023bdaf860aff91c5a9 Mon Sep 17 00:00:00 2001 From: jordan4ibanez Date: Tue, 28 Nov 2023 05:03:08 -0500 Subject: [PATCH] Actually, maybe more functional approach is better --- source/Irrlicht/CB3DJSONMeshFileLoader.cpp | 1 + source/Irrlicht/CB3DJSONMeshFileLoader.h | 8 -------- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/source/Irrlicht/CB3DJSONMeshFileLoader.cpp b/source/Irrlicht/CB3DJSONMeshFileLoader.cpp index 6bb7f30f..2458c099 100644 --- a/source/Irrlicht/CB3DJSONMeshFileLoader.cpp +++ b/source/Irrlicht/CB3DJSONMeshFileLoader.cpp @@ -217,6 +217,7 @@ IAnimatedMesh* CB3DJSONMeshFileLoader::createMesh(io::IReadFile* file) { output[file->getSize()] = '\0'; // We have to catch a JSON parse error or else the game will segfault. + json data; try { data = json::parse(output); } catch (const json::parse_error& e) { diff --git a/source/Irrlicht/CB3DJSONMeshFileLoader.h b/source/Irrlicht/CB3DJSONMeshFileLoader.h index c4bd0dba..c383f03b 100644 --- a/source/Irrlicht/CB3DJSONMeshFileLoader.h +++ b/source/Irrlicht/CB3DJSONMeshFileLoader.h @@ -17,14 +17,6 @@ class CB3DJSONMeshFileLoader : public IMeshLoader private: // Fields. CSkinnedMesh* AnimatedMesh; - /* - Quick note about JSON. - This is static memory, it's a static memory address so I do not think - that this needs to be freed. - So once this model goes out of scope, I'm pretty sure that this will - be pointing to the next model. Or maybe the last model loaded. - */ - json data; // Methods. void cleanUp(std::string);