summaryrefslogtreecommitdiff
path: root/gweb
diff options
context:
space:
mode:
authorJukka Rissanen <jukka.rissanen@linux.intel.com>2012-10-15 10:36:04 (GMT)
committerPatrik Flykt <patrik.flykt@linux.intel.com>2012-10-16 09:19:18 (GMT)
commite7935e3e67ff8d67f5f9c8e68c1f609bd3fa1860 (patch)
treebd6922b22a5d42c09af3a20f87d4e6f9269dcfbe /gweb
parent8b9ed30d94dcfd52a7de68aa39937505599ce722 (diff)
downloadconnman-e7935e3e67ff8d67f5f9c8e68c1f609bd3fa1860.zip
connman-e7935e3e67ff8d67f5f9c8e68c1f609bd3fa1860.tar.gz
connman-e7935e3e67ff8d67f5f9c8e68c1f609bd3fa1860.tar.bz2
gresolv: Remove all pending lookups when resolver is removed
Remove all lookups found in queue when GResolv object is removed.
Diffstat (limited to 'gweb')
-rw-r--r--gweb/gresolv.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/gweb/gresolv.c b/gweb/gresolv.c
index 440f43c..fd4cf10 100644
--- a/gweb/gresolv.c
+++ b/gweb/gresolv.c
@@ -866,6 +866,7 @@ GResolv *g_resolv_ref(GResolv *resolv)
void g_resolv_unref(GResolv *resolv)
{
struct resolv_query *query;
+ struct resolv_lookup *lookup;
if (resolv == NULL)
return;
@@ -873,6 +874,9 @@ void g_resolv_unref(GResolv *resolv)
if (__sync_fetch_and_sub(&resolv->ref_count, 1) != 1)
return;
+ while ((lookup = g_queue_pop_head(resolv->lookup_queue)))
+ g_resolv_cancel_lookup(resolv, lookup->id);
+
while ((query = g_queue_pop_head(resolv->query_queue)))
destroy_query(query);