mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-05-31 22:42:52 +08: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
|
// Clean up the texture palette
|
||||||
--texture->palette->refcount;
|
--texture->palette->refcount;
|
||||||
if (texture->palette->refcount == 0) {
|
if (texture->palette->refcount == 0) {
|
||||||
|
FlushRenderCommandsIfPaletteNeeded(renderer, texture->palette);
|
||||||
renderer->DestroyPalette(renderer, texture->palette);
|
renderer->DestroyPalette(renderer, texture->palette);
|
||||||
SDL_RemoveFromHashTable(renderer->palettes, texture->public_palette);
|
SDL_RemoveFromHashTable(renderer->palettes, texture->public_palette);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user