Explorar o código

Flush rendering if a texture palette is in use when destroyed

Sam Lantinga hai 2 días
pai
achega
9d635fe641
Modificáronse 1 ficheiros con 1 adicións e 0 borrados
  1. 1 0
      src/render/SDL_render.c

+ 1 - 0
src/render/SDL_render.c

@@ -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);
                 }