From 299c1f71f2818f0db5ad6d78d3b797b752c34cec Mon Sep 17 00:00:00 2001 From: Guillaume Zajac Date: Mon, 29 Oct 2012 11:16:39 +0100 Subject: [PATCH] desc-imc-pr3: Check g_source before removing watch --- src/desc_imc_pr3.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/desc_imc_pr3.c b/src/desc_imc_pr3.c index 0998e0c..7ec076a 100644 --- a/src/desc_imc_pr3.c +++ b/src/desc_imc_pr3.c @@ -450,7 +450,11 @@ static TReturn hal_setup_pdp(CoreObject *co, TcoreHalSetupPDPCallBack func, cdata = tcore_hal_ref_user_data(hal); if (cdata->channel) { - g_source_remove(cdata->watch_id); + if (cdata->watch_id > 0) { + g_source_remove(cdata->watch_id); + cdata->watch_id = 0; + } + g_io_channel_unref(cdata->channel); g_free(cdata); -- 2.7.4