From: Luiz Augusto von Dentz <luiz.von.dentz@xxxxxxxxx> If the id is 0 that makes it is invalid already. --- src/shared/timeout-glib.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/shared/timeout-glib.c b/src/shared/timeout-glib.c index 4163bced7..fd71ca430 100644 --- a/src/shared/timeout-glib.c +++ b/src/shared/timeout-glib.c @@ -71,8 +71,12 @@ unsigned int timeout_add(unsigned int timeout, timeout_func_t func, void timeout_remove(unsigned int id) { - GSource *source = g_main_context_find_source_by_id(NULL, id); + GSource *source; + if (!id) + return; + + source = g_main_context_find_source_by_id(NULL, id); if (source) g_source_destroy(source); } -- 2.17.2