window-list: disconnect scale_factor signal on destroy (fixes SIGSEGV on window close)#472
Merged
Merged
Conversation
…d on destroy The scale_factor signal connection added in 25d9879 is the only connection in WayfireToplevel::impl that is not stored in the \`signals\` vector, so it is never disconnected. When a toplevel is destroyed (e.g. closing or restarting an application) the button's scale_factor still changes during teardown and fires on_scale_update() on the freed object, crashing wf-panel with SIGSEGV inside the GTK4 style chain (set_app_id -> image_set_icon on a destroyed Gtk::Image). Store the connection in \`signals\` like every other connection so the destructor disconnects it.
Collaborator
|
It seems odd to me that this doesn't cause a crash on any of my machines. That aside, this fix is still the correct thing to do, even if I can't reproduce the crash. Thank you for the PR! |
Contributor
Author
|
I found it with manual restart of an app but the following script should catch it as well: pid=$(pgrep -x wf-panel) app=${1:-konsole} # pass another GUI app as $1 if you prefer, e.g. ./script.sh alacritty for i in $(seq 30); do |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Since 25d9879 (window-list icon-size), wf-panel crashes with SIGSEGV when a window closes — e.g. restarting an application.
The scale_factor signal connection added in that commit is the only connection in
WayfireToplevel::implthat is not stored in thesignalsvector. Every other connection is stored and disconnected in the destructor:Because this one is untracked, it is never disconnected. When the toplevel is destroyed, the button's
scale_factorproperty still changes during teardown and fireson_scale_update()on the freed object →set_app_id()→IconProvider::image_set_icon()on a destroyedGtk::Image, crashing inside the GTK4 CSS/style chain.Fix: store the connection in
signalslike all the others so it is cleaned up with them.Reproduce: launch a GUI application, then close/restart it — wf-panel crashes. With this patch the panel survives repeated open/close cycles.