Diff between 6d5ce1babb6661616779358c25c7e747e5c06dea and 166ef636d7e8a1d7d70f1e7d2ae849add0eab555

Changed Files

File Additions Deletions Status
unit/test-hfp.c +4 -1 modified

Full Patch

diff --git a/unit/test-hfp.c b/unit/test-hfp.c
index 445fcb7..20aa0b5 100644
--- a/unit/test-hfp.c
+++ b/unit/test-hfp.c
@@ -121,6 +121,8 @@ static gboolean test_handler(GIOChannel *channel, GIOCondition cond,
 	g_assert(!pdu->valid);
 	context_quit(context);
 
+	context->watch_id = 0;
+
 	return FALSE;
 }
 
@@ -187,7 +189,8 @@ static void execute_context(struct context *context)
 {
 	g_main_loop_run(context->main_loop);
 
-	g_source_remove(context->watch_id);
+	if (context->watch_id)
+		g_source_remove(context->watch_id);
 
 	g_main_loop_unref(context->main_loop);