diff --git a/src/render/software/SDL_render_sw.c b/src/render/software/SDL_render_sw.c index edf492327..7ba51a8e2 100644 --- a/src/render/software/SDL_render_sw.c +++ b/src/render/software/SDL_render_sw.c @@ -980,8 +980,12 @@ static void SW_DestroyTexture(SDL_Renderer *renderer, SDL_Texture *texture) static void SW_DestroyRenderer(SDL_Renderer *renderer) { + SDL_Window *window = renderer->window; SW_RenderData *data = (SW_RenderData *)renderer->driverdata; + if (window) { + SDL_DestroyWindowSurface(window); + } SDL_free(data); SDL_free(renderer); } @@ -1035,8 +1039,6 @@ SDL_Renderer *SW_CreateRendererForSurface(SDL_Surface *surface) renderer->info = SW_RenderDriver.info; renderer->driverdata = data; - SW_ActivateRenderer(renderer); - return renderer; }