Zero g1 elements when freeing images

This is to help diagnose issues where we are drawing invalid sprites as well as general cleanliness
This commit is contained in:
Ted John 2016-07-16 18:07:48 +01:00
parent 83fa818190
commit 964cf66f6b
1 changed files with 9 additions and 0 deletions

View File

@ -145,6 +145,15 @@ extern "C"
{
if (baseImageId != 0)
{
// Zero the G1 elements so we don't have invalid pointers
// and data lying about
for (uint32 i = 0; i < count; i++)
{
uint32 imageId = baseImageId + i;
g1Elements[imageId] = { 0 };
drawing_engine_invalidate_image(imageId);
}
FreeImageList(baseImageId, count);
}
}