Commit a217626e authored by Matthias Treydte's avatar Matthias Treydte Committed by Rémi Denis-Courmont

wayland/shell: Fix race for wnd->display.wl.

The Wayland background thread dereferences said variable, but is started
before the value is written there. Occasionally the thread would win
the race and segfault in wl_display_get_fd.
Signed-off-by: default avatarRémi Denis-Courmont <remi@remlab.net>
parent 2226f517
...@@ -351,9 +351,6 @@ static int Open(vout_window_t *wnd, const vout_window_cfg_t *cfg) ...@@ -351,9 +351,6 @@ static int Open(vout_window_t *wnd, const vout_window_cfg_t *cfg)
//if (var_InheritBool (wnd, "keyboard-events")) //if (var_InheritBool (wnd, "keyboard-events"))
// do_something(); // do_something();
if (vlc_clone (&sys->thread, Thread, wnd, VLC_THREAD_PRIORITY_LOW))
goto error;
wl_display_flush(display); wl_display_flush(display);
wnd->type = VOUT_WINDOW_TYPE_WAYLAND; wnd->type = VOUT_WINDOW_TYPE_WAYLAND;
...@@ -361,6 +358,9 @@ static int Open(vout_window_t *wnd, const vout_window_cfg_t *cfg) ...@@ -361,6 +358,9 @@ static int Open(vout_window_t *wnd, const vout_window_cfg_t *cfg)
wnd->display.wl = display; wnd->display.wl = display;
wnd->control = Control; wnd->control = Control;
if (vlc_clone (&sys->thread, Thread, wnd, VLC_THREAD_PRIORITY_LOW))
goto error;
vout_window_ReportSize(wnd, cfg->width, cfg->height); vout_window_ReportSize(wnd, cfg->width, cfg->height);
return VLC_SUCCESS; return VLC_SUCCESS;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment