diff --git a/src/render/opengles/SDL_render_gles.c b/src/render/opengles/SDL_render_gles.c index a164f8789..ec05af03d 100644 --- a/src/render/opengles/SDL_render_gles.c +++ b/src/render/opengles/SDL_render_gles.c @@ -1013,6 +1013,13 @@ GLES_DestroyTexture(SDL_Renderer * renderer, SDL_Texture * texture) GLES_ActivateRenderer(renderer); + if (renderdata->drawstate.texture == texture) { + renderdata->drawstate.texture = NULL; + } + if (renderdata->drawstate.target == texture) { + renderdata->drawstate.target = NULL; + } + if (!data) { return; }