fix another potential memory leak

This commit is contained in:
A-lex-Ra 2023-12-18 21:18:57 +06:00
parent afedd103e8
commit 8a0a4fb898
2 changed files with 6 additions and 0 deletions

View File

@ -27,3 +27,8 @@ ContentGfxCache::ContentGfxCache(const Content* content, Assets* assets) {
} }
} }
} }
ContentGfxCache::~ContentGfxCache()
{
delete[] sideregions;
}

View File

@ -12,6 +12,7 @@ class ContentGfxCache {
UVRegion* sideregions; UVRegion* sideregions;
public: public:
ContentGfxCache(const Content* content, Assets* assets); ContentGfxCache(const Content* content, Assets* assets);
~ContentGfxCache();
inline const UVRegion& getRegion(blockid_t id, int side) const { inline const UVRegion& getRegion(blockid_t id, int side) const {
return sideregions[id * 6 + side]; return sideregions[id * 6 + side];