mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-02-13 15:23:34 +00:00
Flush rendering if a texture palette is in use when destroyed
This commit is contained in:
@@ -1941,6 +1941,7 @@ bool SDL_SetTexturePalette(SDL_Texture *texture, SDL_Palette *palette)
|
||||
// Clean up the texture palette
|
||||
--texture->palette->refcount;
|
||||
if (texture->palette->refcount == 0) {
|
||||
FlushRenderCommandsIfPaletteNeeded(renderer, texture->palette);
|
||||
renderer->DestroyPalette(renderer, texture->palette);
|
||||
SDL_RemoveFromHashTable(renderer->palettes, texture->public_palette);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user