summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: f988e12)
raw | patch | inline | side by side (parent: f988e12)
author | Max Kellermann <max@duempel.org> | |
Mon, 22 Sep 2008 08:04:33 +0000 (10:04 +0200) | ||
committer | Max Kellermann <max@duempel.org> | |
Mon, 22 Sep 2008 08:04:33 +0000 (10:04 +0200) |
Before terminating ncmpc, free the keyboard GIOChannel object.
src/main.c | patch | blob | history |
diff --git a/src/main.c b/src/main.c
index 6f662f53c76da970779a0908b504975623c9edca..5dac8b92bb043d8ce5b84ad917d39b49086d825c 100644 (file)
--- a/src/main.c
+++ b/src/main.c
{
struct sigaction act;
const char *charset = NULL;
+ GIOChannel *keyboard_channel;
#ifdef HAVE_LOCALE_H
/* time and date formatting */
main_loop = g_main_loop_new(NULL, FALSE);
/* watch out for keyboard input */
- g_io_add_watch(g_io_channel_unix_new(STDIN_FILENO), G_IO_IN,
- keyboard_event, NULL);
+ keyboard_channel = g_io_channel_unix_new(STDIN_FILENO);
+ g_io_add_watch(keyboard_channel, G_IO_IN, keyboard_event, NULL);
/* attempt to connect */
reconnect_source_id = g_timeout_add(1, timer_reconnect, NULL);
idle_source_id = g_timeout_add(idle_interval, timer_idle, NULL);
g_main_loop_run(main_loop);
+
+ /* cleanup */
+
g_main_loop_unref(main_loop);
+ g_io_channel_unref(keyboard_channel);
exit_and_cleanup();
}