src/render/opengles2/SDL_render_gles2.c
changeset 12377 84618d571795
parent 12164 8b71c22d6714
child 12381 dc9108cd4340
     1.1 --- a/src/render/opengles2/SDL_render_gles2.c	Wed Oct 31 15:16:51 2018 -0700
     1.2 +++ b/src/render/opengles2/SDL_render_gles2.c	Wed Oct 31 20:17:53 2018 -0700
     1.3 @@ -2122,7 +2122,7 @@
     1.4  
     1.5      data = (GLES2_DriverContext *)SDL_calloc(1, sizeof(GLES2_DriverContext));
     1.6      if (!data) {
     1.7 -        GLES2_DestroyRenderer(renderer);
     1.8 +        SDL_free(renderer);
     1.9          SDL_OutOfMemory();
    1.10          goto error;
    1.11      }
    1.12 @@ -2134,16 +2134,21 @@
    1.13      /* Create an OpenGL ES 2.0 context */
    1.14      data->context = SDL_GL_CreateContext(window);
    1.15      if (!data->context) {
    1.16 -        GLES2_DestroyRenderer(renderer);
    1.17 +        SDL_free(renderer);
    1.18 +        SDL_free(data);
    1.19          goto error;
    1.20      }
    1.21      if (SDL_GL_MakeCurrent(window, data->context) < 0) {
    1.22 -        GLES2_DestroyRenderer(renderer);
    1.23 +        SDL_GL_DeleteContext(data->context);
    1.24 +        SDL_free(renderer);
    1.25 +        SDL_free(data);
    1.26          goto error;
    1.27      }
    1.28  
    1.29      if (GLES2_LoadFunctions(data) < 0) {
    1.30 -        GLES2_DestroyRenderer(renderer);
    1.31 +        SDL_GL_DeleteContext(data->context);
    1.32 +        SDL_free(renderer);
    1.33 +        SDL_free(data);
    1.34          goto error;
    1.35      }
    1.36