src/video/android/SDL_androidwindow.c
changeset 7986 ffb7bf531644
parent 7659 ac4ce59c40e7
child 8093 b43765095a6f
     1.1 --- a/src/video/android/SDL_androidwindow.c	Thu Nov 14 14:45:00 2013 -0500
     1.2 +++ b/src/video/android/SDL_androidwindow.c	Thu Nov 14 20:14:02 2013 -0300
     1.3 @@ -72,6 +72,7 @@
     1.4      data->egl_surface = SDL_EGL_CreateSurface(_this, (NativeWindowType) data->native_window);
     1.5  
     1.6      if (data->egl_surface == EGL_NO_SURFACE) {
     1.7 +        ANativeWindow_release(data->native_window);
     1.8          SDL_free(data);
     1.9          return SDL_SetError("Could not create GLES window surface");
    1.10      }
    1.11 @@ -102,6 +103,9 @@
    1.12          
    1.13          if(window->driverdata) {
    1.14              data = (SDL_WindowData *) window->driverdata;
    1.15 +            if (data->egl_surface != EGL_NO_SURFACE) {
    1.16 +                SDL_EGL_DestroySurface(_this, data->egl_surface);
    1.17 +            }
    1.18              if(data->native_window) {
    1.19                  ANativeWindow_release(data->native_window);
    1.20              }