src/video/android/SDL_androidwindow.c
changeset 7986 ffb7bf531644
parent 7659 ac4ce59c40e7
child 8093 b43765095a6f
equal deleted inserted replaced
7985:1e2d63f57e04 7986:ffb7bf531644
    70     }
    70     }
    71     
    71     
    72     data->egl_surface = SDL_EGL_CreateSurface(_this, (NativeWindowType) data->native_window);
    72     data->egl_surface = SDL_EGL_CreateSurface(_this, (NativeWindowType) data->native_window);
    73 
    73 
    74     if (data->egl_surface == EGL_NO_SURFACE) {
    74     if (data->egl_surface == EGL_NO_SURFACE) {
       
    75         ANativeWindow_release(data->native_window);
    75         SDL_free(data);
    76         SDL_free(data);
    76         return SDL_SetError("Could not create GLES window surface");
    77         return SDL_SetError("Could not create GLES window surface");
    77     }
    78     }
    78 
    79 
    79     window->driverdata = data;
    80     window->driverdata = data;
   100         Android_PauseSem = NULL;
   101         Android_PauseSem = NULL;
   101         Android_ResumeSem = NULL;
   102         Android_ResumeSem = NULL;
   102         
   103         
   103         if(window->driverdata) {
   104         if(window->driverdata) {
   104             data = (SDL_WindowData *) window->driverdata;
   105             data = (SDL_WindowData *) window->driverdata;
       
   106             if (data->egl_surface != EGL_NO_SURFACE) {
       
   107                 SDL_EGL_DestroySurface(_this, data->egl_surface);
       
   108             }
   105             if(data->native_window) {
   109             if(data->native_window) {
   106                 ANativeWindow_release(data->native_window);
   110                 ANativeWindow_release(data->native_window);
   107             }
   111             }
   108             SDL_free(window->driverdata);
   112             SDL_free(window->driverdata);
   109             window->driverdata = NULL;
   113             window->driverdata = NULL;