Skip to content

Commit

Permalink
Finish any drawing when destroying a software renderer
Browse files Browse the repository at this point in the history
Fixes the SDL3 version of libsdl-org/sdl2-compat#373
  • Loading branch information
slouken committed Feb 20, 2025
1 parent 1a85397 commit 8f4c5e1
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/render/SDL_render.c
Original file line number Diff line number Diff line change
Expand Up @@ -5214,7 +5214,12 @@ void SDL_DestroyRendererWithoutFreeing(SDL_Renderer *renderer)
SDL_RemoveWindowRenderer(renderer->window, renderer);
}

SDL_DiscardAllCommands(renderer);
if (renderer->software) {
// Make sure all drawing to a surface is complete
FlushRenderCommands(renderer);
} else {
SDL_DiscardAllCommands(renderer);
}

if (renderer->debug_char_texture_atlas) {
SDL_DestroyTexture(renderer->debug_char_texture_atlas);
Expand Down

0 comments on commit 8f4c5e1

Please sign in to comment.