src/video/SDL_egl.c
changeset 9771 30a317c4af6c
parent 9637 adf81fe554b9
child 9772 ef27c10db4bf
     1.1 --- a/src/video/SDL_egl.c	Sat Jun 20 11:15:37 2015 +0200
     1.2 +++ b/src/video/SDL_egl.c	Sun Jun 21 17:33:46 2015 +0200
     1.3 @@ -72,6 +72,7 @@
     1.4  _this->egl_data->NAME = SDL_LoadFunction(_this->egl_data->dll_handle, #NAME); \
     1.5  if (!_this->egl_data->NAME) \
     1.6  { \
     1.7 +    SDL_EGL_UnloadLibrary(_this); \
     1.8      return SDL_SetError("Could not retrieve EGL function " #NAME); \
     1.9  }
    1.10      
    1.11 @@ -219,6 +220,7 @@
    1.12      _this->egl_data->egl_dll_handle = egl_dll_handle;
    1.13  
    1.14      if (egl_dll_handle == NULL) {
    1.15 +        SDL_EGL_UnloadLibrary(_this);
    1.16          return SDL_SetError("Could not initialize OpenGL / GLES library");
    1.17      }
    1.18  
    1.19 @@ -240,6 +242,7 @@
    1.20              if (dll_handle != NULL) {
    1.21                  SDL_UnloadObject(dll_handle);
    1.22              }
    1.23 +            SDL_EGL_UnloadLibrary(_this);
    1.24              return SDL_SetError("Could not load EGL library");
    1.25          }
    1.26          SDL_ClearError();
    1.27 @@ -269,10 +272,12 @@
    1.28  #if !defined(__WINRT__)
    1.29      _this->egl_data->egl_display = _this->egl_data->eglGetDisplay(native_display);
    1.30      if (!_this->egl_data->egl_display) {
    1.31 +        SDL_EGL_UnloadLibrary(_this);
    1.32          return SDL_SetError("Could not get EGL display");
    1.33      }
    1.34      
    1.35      if (_this->egl_data->eglInitialize(_this->egl_data->egl_display, NULL, NULL) != EGL_TRUE) {
    1.36 +        SDL_EGL_UnloadLibrary(_this);
    1.37          return SDL_SetError("Could not initialize EGL");
    1.38      }
    1.39  #endif