From 8111a632be9c6572142a0565e24603d5f0006c6b Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Wed, 3 Jan 2018 10:49:26 -0800 Subject: [PATCH] Fixed bug 4013 - Wayland: fix videoquit on multimonitor system Vladimir On multimonitor system Wayland_VideoQuit invalid deiniting. Tested in Centos7 + Weston --- src/video/wayland/SDL_waylandvideo.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/video/wayland/SDL_waylandvideo.c b/src/video/wayland/SDL_waylandvideo.c index 759042b8fa78c..5dd48631ad2ed 100644 --- a/src/video/wayland/SDL_waylandvideo.c +++ b/src/video/wayland/SDL_waylandvideo.c @@ -233,6 +233,7 @@ display_handle_mode(void *data, mode.w = width; mode.h = height; mode.refresh_rate = refresh / 1000; // mHz to Hz + mode.driverdata = display->driverdata; SDL_AddDisplayMode(display, &mode); if (flags & WL_OUTPUT_MODE_CURRENT) { @@ -408,7 +409,7 @@ void Wayland_VideoQuit(_THIS) { SDL_VideoData *data = _this->driverdata; - int i; + int i, j; Wayland_FiniMouse (); @@ -416,6 +417,11 @@ Wayland_VideoQuit(_THIS) SDL_VideoDisplay *display = &_this->displays[i]; wl_output_destroy(display->driverdata); display->driverdata = NULL; + + for (j = display->num_display_modes; j--;) { + display->display_modes[j].driverdata = NULL; + } + display->desktop_mode.driverdata = NULL; } Wayland_display_destroy_input(data);