seat: fix closing dummy sessions
We must reset the "dummy" pointer when unregistering dummy sessions, otherwise, we will get NULL pointer derefs. This also prevents keyboard-input from closing dummy sessions. Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
This commit is contained in:
parent
0cd57e21ae
commit
55410d376a
@ -338,6 +338,9 @@ static void seat_input_event(struct uterm_input *input,
|
||||
if (conf_grab_matches(seat->conf->grab_session_close,
|
||||
ev->mods, ev->num_syms, ev->keysyms)) {
|
||||
ev->handled = true;
|
||||
if (seat->cur_sess == seat->dummy)
|
||||
return;
|
||||
|
||||
kmscon_session_unregister(seat->cur_sess);
|
||||
return;
|
||||
}
|
||||
@ -648,6 +651,9 @@ void kmscon_session_unregister(struct kmscon_session *sess)
|
||||
|
||||
log_debug("unregister session %p", sess);
|
||||
|
||||
if (sess->seat->dummy == sess)
|
||||
sess->seat->dummy = NULL;
|
||||
|
||||
session_deactivate(sess);
|
||||
shl_dlist_unlink(&sess->list);
|
||||
--sess->seat->session_count;
|
||||
|
Loading…
x
Reference in New Issue
Block a user