Skip to content

fix(amodule): prevent crash when cursor timeout fires after destruction#5058

Open
typedrifter wants to merge 1 commit into
Alexays:masterfrom
typedrifter:fix-cursor-crash
Open

fix(amodule): prevent crash when cursor timeout fires after destruction#5058
typedrifter wants to merge 1 commit into
Alexays:masterfrom
typedrifter:fix-cursor-crash

Conversation

@typedrifter
Copy link
Copy Markdown

Hey,
Waybar segfaults when my monitor turns off as stated in #5055

I narrowed it down to AModule::setCursor():
When the window isn't ready, setCursor() schedules a 1-second retry. If the output gets removed and the module is destroyed before that timeout fires it crashes.

The fix stores the timeout connection and disconnects it in the destructor, kinda same as what privacy and idle_inhibitor modules already do.

Tested with my config that was crashing 100% after the monitor was shutdown and turned back on, and the crashes have stopped.

Fixes #5055

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Crash on monitor off with cursor: true in drawer group custom modules

1 participant