summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 6b7b46f)
raw | patch | inline | side by side (parent: 6b7b46f)
author | Max Kellermann <max@duempel.org> | |
Fri, 14 Aug 2009 21:50:17 +0000 (23:50 +0200) | ||
committer | Max Kellermann <max@duempel.org> | |
Fri, 14 Aug 2009 21:50:17 +0000 (23:50 +0200) |
Make valgrind happier.
src/main.c | patch | blob | history |
diff --git a/src/main.c b/src/main.c
index fc733664c93a39a91ac282e982b4af35180b62b9..ed759774430329ae027b54214448d77f340c2260 100644 (file)
--- a/src/main.c
+++ b/src/main.c
static GMainLoop *main_loop;
static guint reconnect_source_id, idle_source_id, update_source_id;
+#ifndef NCMPC_MINI
+static guint check_key_bindings_source_id;
+#endif
+
static const gchar *
error_msg(const gchar *msg)
{
gboolean key_error;
key_error = check_key_bindings(NULL, buf, sizeof(buf));
- if (!key_error)
+ if (!key_error) {
/* no error: disable this timer for the rest of this
process */
+ check_key_bindings_source_id = 0;
return FALSE;
+ }
#ifdef ENABLE_KEYDEF_SCREEN
g_strchomp(buf);
timer_mpd_update,
GINT_TO_POINTER(TRUE));
#ifndef NCMPC_MINI
- g_timeout_add(10000, timer_check_key_bindings, NULL);
+ check_key_bindings_source_id = g_timeout_add(10000, timer_check_key_bindings, NULL);
#endif
idle_source_id = g_timeout_add(idle_interval, timer_idle, NULL);
/* cleanup */
+ g_source_remove(update_source_id);
+ g_source_remove(idle_source_id);
+
+#ifndef NCMPC_MINI
+ if (check_key_bindings_source_id != 0)
+ g_source_remove(check_key_bindings_source_id);
+#endif
+
g_main_loop_unref(main_loop);
g_io_channel_unref(keyboard_channel);