diff options
author | Jukka Rissanen <jukka.rissanen@linux.intel.com> | 2012-10-15 13:36:04 +0300 |
---|---|---|
committer | Patrik Flykt <patrik.flykt@linux.intel.com> | 2012-10-16 12:19:18 +0300 |
commit | e7935e3e67ff8d67f5f9c8e68c1f609bd3fa1860 (patch) | |
tree | bd6922b22a5d42c09af3a20f87d4e6f9269dcfbe /gweb | |
parent | 8b9ed30d94dcfd52a7de68aa39937505599ce722 (diff) | |
download | connman-e7935e3e67ff8d67f5f9c8e68c1f609bd3fa1860.tar.gz connman-e7935e3e67ff8d67f5f9c8e68c1f609bd3fa1860.tar.bz2 connman-e7935e3e67ff8d67f5f9c8e68c1f609bd3fa1860.zip |
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.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/gweb/gresolv.c b/gweb/gresolv.c index 440f43c1..fd4cf107 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); |