Skip to content
This repository was archived by the owner on Nov 1, 2021. It is now read-only.

text-input: fix releasing destroy handlers#1303

Merged
emersion merged 1 commit intoswaywm:masterfrom
dcz-purism:fix_surface_gone
Oct 12, 2018
Merged

text-input: fix releasing destroy handlers#1303
emersion merged 1 commit intoswaywm:masterfrom
dcz-purism:fix_surface_gone

Conversation

@dcz-purism
Copy link
Copy Markdown
Contributor

It was possible for listeners on text-input objects to be still attached to signals even after the objects were gone, causing crashes depending on the order objects were destroyed. Not after this patch.


static void wlr_text_input_destroy(struct wlr_text_input_v3 *text_input) {
wlr_signal_emit_safe(&text_input->events.destroy, text_input);
if (text_input->focused_surface) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of adding conditions like this, you can always call wl_list_remove, and call wl_list_init when the surface is removed.

@dcz-purism
Copy link
Copy Markdown
Contributor Author

I found another place where the handler needs to be released in text-input, and I added list_init to all the relevant places. With inits, the patch touches more places, but conditions are gone.

@emersion emersion merged commit 3ceb064 into swaywm:master Oct 12, 2018
@emersion
Copy link
Copy Markdown
Member

Thanks!

xdavidwu added a commit to xdavidwu/sway that referenced this pull request Oct 18, 2019
Leo1003 pushed a commit to xdavidwu/sway that referenced this pull request Nov 15, 2019
Leo1003 added a commit to xdavidwu/sway that referenced this pull request Nov 20, 2019
This ports swaywm/wlroots#1203, swaywm/wlroots#1303,
swaywm/wlroots#1308, swaywm/wlroots#1759 rootston part to sway.

Co-Authored-By: Leo Chen <leo881003@gmail.com>
Leo1003 added a commit to xdavidwu/sway that referenced this pull request Nov 20, 2019
This ports swaywm/wlroots#1203, swaywm/wlroots#1303,
swaywm/wlroots#1308, swaywm/wlroots#1759 rootston part to sway.

Co-Authored-By: Leo Chen <leo881003@gmail.com>
xdavidwu added a commit to xdavidwu/sway that referenced this pull request Jan 2, 2020
This ports swaywm/wlroots#1203, swaywm/wlroots#1303,
swaywm/wlroots#1308, swaywm/wlroots#1759 rootston part to sway.

Co-Authored-By: Leo Chen <leo881003@gmail.com>
xdavidwu added a commit to xdavidwu/sway that referenced this pull request Jan 12, 2020
This ports swaywm/wlroots#1203, swaywm/wlroots#1303,
swaywm/wlroots#1308, swaywm/wlroots#1759 rootston part to sway.

Co-Authored-By: Leo Chen <leo881003@gmail.com>
xdavidwu added a commit to xdavidwu/sway that referenced this pull request Jan 21, 2020
This ports swaywm/wlroots#1203, swaywm/wlroots#1303,
swaywm/wlroots#1308, swaywm/wlroots#1759 rootston part to sway.

Co-Authored-By: Leo Chen <leo881003@gmail.com>
xdavidwu added a commit to xdavidwu/sway that referenced this pull request Feb 14, 2020
This ports swaywm/wlroots#1203, swaywm/wlroots#1303,
swaywm/wlroots#1308, swaywm/wlroots#1759 rootston part to sway.

Co-Authored-By: Leo Chen <leo881003@gmail.com>
xdavidwu added a commit to xdavidwu/sway that referenced this pull request Feb 20, 2020
This ports swaywm/wlroots#1203, swaywm/wlroots#1303,
swaywm/wlroots#1308, swaywm/wlroots#1759 rootston part to sway.

Co-Authored-By: Leo Chen <leo881003@gmail.com>
xdavidwu added a commit to xdavidwu/sway that referenced this pull request Feb 27, 2020
This ports swaywm/wlroots#1203, swaywm/wlroots#1303,
swaywm/wlroots#1308, swaywm/wlroots#1759 rootston part to sway.

Co-Authored-By: Leo Chen <leo881003@gmail.com>
xdavidwu added a commit to xdavidwu/sway that referenced this pull request Mar 11, 2020
This ports swaywm/wlroots#1203, swaywm/wlroots#1303,
swaywm/wlroots#1308, swaywm/wlroots#1759 rootston part to sway.

Co-Authored-By: Leo Chen <leo881003@gmail.com>
Leo1003 added a commit to xdavidwu/sway that referenced this pull request Mar 24, 2020
This ports swaywm/wlroots#1203, swaywm/wlroots#1303,
swaywm/wlroots#1308, swaywm/wlroots#1759 rootston part to sway.

Co-Authored-By: Leo Chen <leo881003@gmail.com>
Leo1003 added a commit to xdavidwu/sway that referenced this pull request Apr 4, 2020
This ports swaywm/wlroots#1203, swaywm/wlroots#1303,
swaywm/wlroots#1308, swaywm/wlroots#1759 rootston part to sway.

Co-Authored-By: Leo Chen <leo881003@gmail.com>
emersion pushed a commit to swaywm/sway that referenced this pull request Apr 4, 2020
This ports swaywm/wlroots#1203, swaywm/wlroots#1303,
swaywm/wlroots#1308, swaywm/wlroots#1759 rootston part to sway.

Co-Authored-By: Leo Chen <leo881003@gmail.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants