diff options
| author | Daniel Eklöf <daniel@ekloef.se> | 2023-07-18 14:13:36 +0000 |
|---|---|---|
| committer | Daniel Eklöf <daniel@ekloef.se> | 2023-07-18 16:26:28 +0000 |
| commit | fdd753263b3ebe96a83c73fbf560773dce04efd0 (patch) | |
| tree | 16d28b76ac36f3538fed5e8ef2bc2a0770e10a9e /terminal.c | |
| parent | themes: starlight: update to V4 (diff) | |
term: destroy: unref key bindings *after* destroying window
This fixes a crash-on-exit on compositors that emit a _"keyboard
leave"_ event when a surface is unmapped.
In our case, destroying the window (where we unmap it) in
term_destroy(), lead to a crash in term_mouse_grabbed(), due to
key_binding_for() returning NULL.
The call chain in this is case is, roughly:
term_destroy() ->
wayl_win_destroy() ->
keyboard_leave() ->
term_xcursor_update_for_seat() ->
term_mouse_grabbed()
Diffstat (limited to 'terminal.c')
| -rw-r--r-- | terminal.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -1607,8 +1607,6 @@ term_destroy(struct terminal *term) if (term == NULL) return 0; - key_binding_unref(term->wl->key_binding_manager, term->conf); - tll_foreach(term->wl->terms, it) { if (it->item == term) { tll_remove(term->wl->terms, it); @@ -1654,6 +1652,8 @@ term_destroy(struct terminal *term) } mtx_unlock(&term->render.workers.lock); + key_binding_unref(term->wl->key_binding_manager, term->conf); + urls_reset(term); free(term->vt.osc.data); |
