From 8a0a4fb898e1add7f739d764c6805625b697ce26 Mon Sep 17 00:00:00 2001 From: A-lex-Ra Date: Mon, 18 Dec 2023 21:18:57 +0600 Subject: [PATCH] fix another potential memory leak --- src/frontend/ContentGfxCache.cpp | 5 +++++ src/frontend/ContentGfxCache.h | 1 + 2 files changed, 6 insertions(+) diff --git a/src/frontend/ContentGfxCache.cpp b/src/frontend/ContentGfxCache.cpp index 59fe4caa..72e039fb 100644 --- a/src/frontend/ContentGfxCache.cpp +++ b/src/frontend/ContentGfxCache.cpp @@ -27,3 +27,8 @@ ContentGfxCache::ContentGfxCache(const Content* content, Assets* assets) { } } } + +ContentGfxCache::~ContentGfxCache() +{ + delete[] sideregions; +} diff --git a/src/frontend/ContentGfxCache.h b/src/frontend/ContentGfxCache.h index 81c709d8..804d0c15 100644 --- a/src/frontend/ContentGfxCache.h +++ b/src/frontend/ContentGfxCache.h @@ -12,6 +12,7 @@ class ContentGfxCache { UVRegion* sideregions; public: ContentGfxCache(const Content* content, Assets* assets); + ~ContentGfxCache(); inline const UVRegion& getRegion(blockid_t id, int side) const { return sideregions[id * 6 + side];