diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/messages-service.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/messages-service.c b/src/messages-service.c index 71fa09b..0eec2ad 100644 --- a/src/messages-service.c +++ b/src/messages-service.c @@ -25,6 +25,7 @@ with this program. If not, see <http://www.gnu.org/licenses/>. #include <locale.h> #include <gio/gio.h> #include <glib/gi18n.h> +#include <glib-unix.h> #include "dbus-data.h" #include "gsettingsstrv.h" @@ -169,6 +170,16 @@ on_name_lost (GDBusConnection *bus, g_main_loop_quit (mainloop); } +static gboolean +sig_term_handler (gpointer user_data) +{ + GMainLoop *mainloop = user_data; + + g_main_loop_quit (mainloop); + + return FALSE; +} + int main (int argc, char ** argv) { @@ -225,6 +236,8 @@ main (int argc, char ** argv) g_hash_table_insert (menus, "phone", im_phone_menu_new (applications)); g_hash_table_insert (menus, "desktop", im_desktop_menu_new (applications)); + g_unix_signal_add(SIGTERM, sig_term_handler, mainloop); + g_main_loop_run(mainloop); /* Clean up */ |