src/video/wayland/SDL_waylandwindow.c
changeset 8978 7753e4fd3d1d
parent 8766 e5f584f77609
child 9362 dfd8202eb9a7
equal deleted inserted replaced
8977:84ae33058c67 8978:7753e4fd3d1d
   241 void Wayland_DestroyWindow(_THIS, SDL_Window *window)
   241 void Wayland_DestroyWindow(_THIS, SDL_Window *window)
   242 {
   242 {
   243     SDL_VideoData *data = _this->driverdata;
   243     SDL_VideoData *data = _this->driverdata;
   244     SDL_WindowData *wind = window->driverdata;
   244     SDL_WindowData *wind = window->driverdata;
   245 
   245 
   246     window->driverdata = NULL;
       
   247 
       
   248     if (data) {
   246     if (data) {
   249         SDL_EGL_DestroySurface(_this, wind->egl_surface);
   247         SDL_EGL_DestroySurface(_this, wind->egl_surface);
   250         WAYLAND_wl_egl_window_destroy(wind->egl_window);
   248         WAYLAND_wl_egl_window_destroy(wind->egl_window);
   251 
   249 
   252         if (wind->shell_surface)
   250         if (wind->shell_surface)
   259         wl_surface_destroy(wind->surface);
   257         wl_surface_destroy(wind->surface);
   260 
   258 
   261         SDL_free(wind);
   259         SDL_free(wind);
   262         WAYLAND_wl_display_flush(data->display);
   260         WAYLAND_wl_display_flush(data->display);
   263     }
   261     }
       
   262     window->driverdata = NULL;
   264 }
   263 }
   265 
   264 
   266 #endif /* SDL_VIDEO_DRIVER_WAYLAND && SDL_VIDEO_OPENGL_EGL */
   265 #endif /* SDL_VIDEO_DRIVER_WAYLAND && SDL_VIDEO_OPENGL_EGL */
   267 
   266 
   268 /* vi: set ts=4 sw=4 expandtab: */
   267 /* vi: set ts=4 sw=4 expandtab: */