[Commits] SDL: Fixed bug 4013 - Wayland: fix videoquit on multimonitor system

libsdl.org revision control commits-owner at libsdl.org
Wed Jan 3 10:42:24 PST 2018


details:   https://hg.libsdl.org/SDL/rev/0d9b386fefb7
changeset: 11814:0d9b386fefb7
user:      Sam Lantinga <slouken at libsdl.org>
date:      Wed Jan 03 10:49:26 2018 -0800
description:
Fixed bug 4013 - Wayland: fix videoquit on multimonitor system

Vladimir

On multimonitor system Wayland_VideoQuit invalid deiniting.

Tested in Centos7 + Weston

diffstat:

 src/video/wayland/SDL_waylandvideo.c |  8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diffs (32 lines):

diff -r ea7c4b476853 -r 0d9b386fefb7 src/video/wayland/SDL_waylandvideo.c
--- a/src/video/wayland/SDL_waylandvideo.c	Wed Jan 03 10:43:01 2018 -0800
+++ b/src/video/wayland/SDL_waylandvideo.c	Wed Jan 03 10:49:26 2018 -0800
@@ -233,6 +233,7 @@
     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 @@
 Wayland_VideoQuit(_THIS)
 {
     SDL_VideoData *data = _this->driverdata;
-    int i;
+    int i, j;
 
     Wayland_FiniMouse ();
 
@@ -416,6 +417,11 @@
         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);


More information about the commits mailing list