Commit 6b621684 authored by Ray Strode's avatar Ray Strode

main: disconnect shutdown_cb when manager is destroyed

shutdown_cb is supposed to be called when gnome-session is
running and suddenly the bus is ripped away from it.  Unfortunately,
it also gets run as part of the normal shutdown path, which it isn't
designed for.

This commit changes g_signal_connect_swapped to g_signal_connect_object
to ensure the handler is disconnected when the manager object goes away,
so the handler isn't called in the normal shutdown path.

https://bugzilla.gnome.org/show_bug.cgi?id=688992
parent d1f88fbf
......@@ -327,10 +327,11 @@ main (int argc, char **argv)
manager = gsm_manager_new (client_store, failsafe);
g_signal_connect_swapped (bus_proxy,
"destroy",
G_CALLBACK (shutdown_cb),
manager);
g_signal_connect_object (bus_proxy,
"destroy",
G_CALLBACK (shutdown_cb),
manager,
G_CONNECT_SWAPPED);
g_unix_signal_add (SIGTERM, term_or_int_signal_cb, manager);
g_unix_signal_add (SIGINT, term_or_int_signal_cb, manager);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment