mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-06-06 14:43:20 +00:00
Flush rendering if a texture palette is in use when destroyed
This commit is contained in:
parent
3fcac8cc44
commit
9d635fe641
1 changed files with 1 additions and 0 deletions
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue