Core: Fix memory leaks in mCacheSet

This commit is contained in:
Vicki Pfau 2023-04-05 05:06:08 -07:00
parent 121376ccb0
commit 6806850441
1 changed files with 3 additions and 0 deletions

View File

@ -34,12 +34,15 @@ void mCacheSetDeinit(struct mCacheSet* cache) {
for (i = 0; i < mMapCacheSetSize(&cache->maps); ++i) { for (i = 0; i < mMapCacheSetSize(&cache->maps); ++i) {
mMapCacheDeinit(mMapCacheSetGetPointer(&cache->maps, i)); mMapCacheDeinit(mMapCacheSetGetPointer(&cache->maps, i));
} }
mMapCacheSetDeinit(&cache->maps);
for (i = 0; i < mBitmapCacheSetSize(&cache->bitmaps); ++i) { for (i = 0; i < mBitmapCacheSetSize(&cache->bitmaps); ++i) {
mBitmapCacheDeinit(mBitmapCacheSetGetPointer(&cache->bitmaps, i)); mBitmapCacheDeinit(mBitmapCacheSetGetPointer(&cache->bitmaps, i));
} }
mBitmapCacheSetDeinit(&cache->bitmaps);
for (i = 0; i < mTileCacheSetSize(&cache->tiles); ++i) { for (i = 0; i < mTileCacheSetSize(&cache->tiles); ++i) {
mTileCacheDeinit(mTileCacheSetGetPointer(&cache->tiles, i)); mTileCacheDeinit(mTileCacheSetGetPointer(&cache->tiles, i));
} }
mTileCacheSetDeinit(&cache->tiles);
} }
void mCacheSetAssignVRAM(struct mCacheSet* cache, void* vram) { void mCacheSetAssignVRAM(struct mCacheSet* cache, void* vram) {