fix(bar): avoid use-after-free segfault on exit
Members are destroyed in reverse declaration order, so modules_all_ (and the modules it owns) are gone before the GtkWindow. Tearing down a mapped window emits `unmap`, whose handler runs toggleSuspend() over the already freed modules. Disconnect the map/unmap handlers in ~Bar first. Fixes #5182
This commit is contained in:
@@ -131,6 +131,10 @@ class Bar : public sigc::trackable {
|
||||
|
||||
waybar::util::KillSignalAction onSigusr1 = util::SIGNALACTION_DEFAULT_SIGUSR1;
|
||||
waybar::util::KillSignalAction onSigusr2 = util::SIGNALACTION_DEFAULT_SIGUSR2;
|
||||
|
||||
/* Disconnected in ~Bar before the modules are destroyed (#5182). */
|
||||
sigc::connection map_conn_;
|
||||
sigc::connection unmap_conn_;
|
||||
};
|
||||
|
||||
} // namespace waybar
|
||||
|
||||
Reference in New Issue
Block a user