From 83a6923af0156de7575fac4bfb0ad2ee5023b361 Mon Sep 17 00:00:00 2001 From: Yu A Wang Date: Thu, 8 Dec 2011 02:31:05 -0500 Subject: [PATCH] gdhcp: Check listerner_watch before remove it Fixed following error: connmand[4547]: src/dhcp.c:dhcp_release() dhcp 0x8c6d3e8 connmand[4547]: DHCP: switch listening mode (3 ==> 0) (connmand:4547): GLib-CRITICAL **: g_source_remove: assertion `tag > 0' failed --- gdhcp/client.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gdhcp/client.c b/gdhcp/client.c index 3270346..6df3281 100644 --- a/gdhcp/client.c +++ b/gdhcp/client.c @@ -777,7 +777,8 @@ static int switch_listening_mode(GDHCPClient *dhcp_client, return 0; if (dhcp_client->listen_mode != L_NONE) { - g_source_remove(dhcp_client->listener_watch); + if (dhcp_client->listener_watch > 0) + g_source_remove(dhcp_client->listener_watch); dhcp_client->listener_channel = NULL; dhcp_client->listen_mode = L_NONE; dhcp_client->listener_sockfd = -1; -- 2.7.4