[PATCH 0/1] MR6552: server: Move last_active variable initialization (Valgrind).
Fixes: 5b56bad50b8 ("server: Make window struct a server object.") -- https://gitlab.winehq.org/wine/wine/-/merge_requests/6552
From: Aida Jonikienė <aidas957(a)gmail.com> Fixes: 5b56bad50b8 ("server: Make window struct a server object.") --- server/window.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server/window.c b/server/window.c index 16c2656b8f2..ea86d1cca66 100644 --- a/server/window.c +++ b/server/window.c @@ -564,7 +564,7 @@ static struct window *create_window( struct window *parent, struct window *owner win->desktop = desktop; win->class = class; win->atom = atom; - win->last_active = win->handle; + win->last_active = 0; win->win_region = NULL; win->update_region = NULL; win->style = 0; @@ -597,6 +597,7 @@ static struct window *create_window( struct window *parent, struct window *owner win->nb_extra_bytes = extra_bytes; } if (!(win->handle = alloc_user_handle( win, USER_WINDOW ))) goto failed; + else win->last_active = win->handle; /* if parent belongs to a different thread and the window isn't */ /* top-level, attach the two threads */ -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/6552
Jinoh Kang (@iamahuman) commented about server/window.c:
win->nb_extra_bytes = extra_bytes; } if (!(win->handle = alloc_user_handle( win, USER_WINDOW ))) goto failed; + else win->last_active = win->handle;
Avoid `else` if the `then` branch ends with a return/goto/noreturn. ```suggestion:-0+0 win->last_active = win->handle; ``` -- https://gitlab.winehq.org/wine/wine/-/merge_requests/6552#note_83212
Looks good otherwise :') -- https://gitlab.winehq.org/wine/wine/-/merge_requests/6552#note_83213
participants (2)
-
Aida Jonikienė -
Jinoh Kang (@iamahuman)