Core: Fix memory leaks in mCacheSet

This commit is contained in:
Vicki Pfau 2023-04-05 05:06:08 -07:00
parent 03d1ed7778
commit a039e2fbef
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) {