Small memory fixes.

This commit is contained in:
din
2020-05-14 16:19:23 -05:00
parent 09444bcb74
commit 653e8ff6fe
3 changed files with 12 additions and 5 deletions
+5 -1
View File
@@ -123,7 +123,6 @@ static RageSurface *RageSurface_Load_PNG( RageFile *f, const char *fn, char erro
CHECKPOINT_M("Header only png about to be processed.");
img = CreateSurfaceFrom( width, height, 32, 0, 0, 0, 0, nullptr, width*4 );
png_destroy_read_struct( &png, &info_ptr, nullptr );
return img;
}
@@ -255,6 +254,11 @@ static RageSurface *RageSurface_Load_PNG( RageFile *f, const char *fn, char erro
png_read_end( png, info_ptr );
png_destroy_read_struct( &png, &info_ptr, nullptr );
if(row_pointers != nullptr)
{
delete[] row_pointers;
}
return img;
}