Commit ebd9efb3616d070d41a50651dfdd7e8b197d76bb

Sylvain Becker 2018-12-29T16:37:44

opengles 1: same fix as in bug #4433

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
diff --git a/src/render/opengles/SDL_render_gles.c b/src/render/opengles/SDL_render_gles.c
index a164f87..ec05af0 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;
     }