Destroy the window surface if we've created it for the software renderer
Fixes https://github.com/libsdl-org/SDL/issues/8011main
parent
28e623c504
commit
521bbcc15e
|
@ -990,8 +990,12 @@ static void SW_DestroyTexture(SDL_Renderer *renderer, SDL_Texture *texture)
|
||||||
|
|
||||||
static void SW_DestroyRenderer(SDL_Renderer *renderer)
|
static void SW_DestroyRenderer(SDL_Renderer *renderer)
|
||||||
{
|
{
|
||||||
|
SDL_Window *window = renderer->window;
|
||||||
SW_RenderData *data = (SW_RenderData *)renderer->driverdata;
|
SW_RenderData *data = (SW_RenderData *)renderer->driverdata;
|
||||||
|
|
||||||
|
if (window) {
|
||||||
|
SDL_DestroyWindowSurface(window);
|
||||||
|
}
|
||||||
SDL_free(data);
|
SDL_free(data);
|
||||||
SDL_free(renderer);
|
SDL_free(renderer);
|
||||||
}
|
}
|
||||||
|
@ -1140,8 +1144,6 @@ SDL_Renderer *SW_CreateRendererForSurface(SDL_Surface *surface)
|
||||||
|
|
||||||
SW_SelectBestFormats(renderer, surface->format->format);
|
SW_SelectBestFormats(renderer, surface->format->format);
|
||||||
|
|
||||||
SW_ActivateRenderer(renderer);
|
|
||||||
|
|
||||||
return renderer;
|
return renderer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue