mirror of
https://github.com/Ryujinx/SDL.git
synced 2024-12-23 06:15:35 +00:00
Destroy the window surface if we've created it for the software renderer
Fixes https://github.com/libsdl-org/SDL/issues/8011
This commit is contained in:
parent
4ace02df5f
commit
624905a7f1
|
@ -980,8 +980,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);
|
||||||
}
|
}
|
||||||
|
@ -1035,8 +1039,6 @@ SDL_Renderer *SW_CreateRendererForSurface(SDL_Surface *surface)
|
||||||
renderer->info = SW_RenderDriver.info;
|
renderer->info = SW_RenderDriver.info;
|
||||||
renderer->driverdata = data;
|
renderer->driverdata = data;
|
||||||
|
|
||||||
SW_ActivateRenderer(renderer);
|
|
||||||
|
|
||||||
return renderer;
|
return renderer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue