Flush rendering if a texture palette is in use when destroyed
This commit is contained in:
1 parent
3fcac8cc44
commit
9d635fe641
1 file changed
+1
@@ -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