src/video/wayland/SDL_waylandwindow.c
changeset 8978 7753e4fd3d1d
parent 8766 e5f584f77609
child 9362 dfd8202eb9a7
--- a/src/video/wayland/SDL_waylandwindow.c	Sun Jul 06 22:15:31 2014 +0100
+++ b/src/video/wayland/SDL_waylandwindow.c	Mon Jul 07 10:33:32 2014 -0700
@@ -243,8 +243,6 @@
     SDL_VideoData *data = _this->driverdata;
     SDL_WindowData *wind = window->driverdata;
 
-    window->driverdata = NULL;
-
     if (data) {
         SDL_EGL_DestroySurface(_this, wind->egl_surface);
         WAYLAND_wl_egl_window_destroy(wind->egl_window);
@@ -261,6 +259,7 @@
         SDL_free(wind);
         WAYLAND_wl_display_flush(data->display);
     }
+    window->driverdata = NULL;
 }
 
 #endif /* SDL_VIDEO_DRIVER_WAYLAND && SDL_VIDEO_OPENGL_EGL */