diff --git a/docs/reference/gio/gio-sections.txt b/docs/reference/gio/gio-sections.txt
index 1e47b31..38721bd 100644
--- a/docs/reference/gio/gio-sections.txt
+++ b/docs/reference/gio/gio-sections.txt
@@ -1343,7 +1343,7 @@ g_inet_address_get_type
 GSocketAddress
 g_socket_address_new_from_native
 g_socket_address_to_native
-g_socket_address_native_size
+g_socket_address_get_native_size
 <SUBSECTION Standard>
 GSocketAddressClass
 G_IS_SOCKET_ADDRESS
diff --git a/gio/ginetaddress.c b/gio/ginetaddress.c
index f3b95cd..e4f9159 100644
--- a/gio/ginetaddress.c
+++ b/gio/ginetaddress.c
@@ -1,4 +1,4 @@
-/* GNIO - GLib Network Layer of GIO
+/* GIO - GLib Input, Output and Streaming Library
  *
  * Copyright (C) 2008 Christian Kellner, Samuel Cormier-Iijima
  *
diff --git a/gio/ginetsocketaddress.c b/gio/ginetsocketaddress.c
index 94d3178..99ae63e 100644
--- a/gio/ginetsocketaddress.c
+++ b/gio/ginetsocketaddress.c
@@ -1,4 +1,4 @@
-/* GNIO - GLib Network Layer of GIO
+/* GIO - GLib Input, Output and Streaming Library
  *
  * Copyright (C) 2008 Christian Kellner, Samuel Cormier-Iijima
  *
@@ -126,7 +126,7 @@ g_inet_socket_address_set_property (GObject      *object,
 }
 
 static gssize
-g_inet_socket_address_native_size (GSocketAddress *address)
+g_inet_socket_address_get_native_size (GSocketAddress *address)
 {
   GInetSocketAddress *addr;
   GInetAddressFamily family;
@@ -201,7 +201,7 @@ g_inet_socket_address_class_init (GInetSocketAddressClass *klass)
   gobject_class->get_property = g_inet_socket_address_get_property;
 
   gsocketaddress_class->to_native = g_inet_socket_address_to_native;
-  gsocketaddress_class->native_size = g_inet_socket_address_native_size;
+  gsocketaddress_class->get_native_size = g_inet_socket_address_get_native_size;
 
   g_object_class_install_property (gobject_class, PROP_ADDRESS,
                                    g_param_spec_object ("address",
diff --git a/gio/gio.symbols b/gio/gio.symbols
index 4352be3..08c02de 100644
--- a/gio/gio.symbols
+++ b/gio/gio.symbols
@@ -894,7 +894,7 @@ g_unix_socket_address_new
 #if IN_FILE(__G_SOCKET_ADDRESS_C__)
 g_socket_address_new_from_native
 g_socket_address_get_type G_GNUC_CONST
-g_socket_address_native_size
+g_socket_address_get_native_size
 g_socket_address_to_native
 #endif
 #endif
diff --git a/gio/gnetworkaddress.c b/gio/gnetworkaddress.c
index 6e1c493..9548df6 100644
--- a/gio/gnetworkaddress.c
+++ b/gio/gnetworkaddress.c
@@ -361,13 +361,13 @@ g_network_address_connectable_get_next (GSocketConnectable  *connectable,
     }
 
   if (!addr->priv->iter)
-    sockaddr = NULL;
+    return NULL;
   else
     {
       sockaddr = addr->priv->iter->data;
       addr->priv->iter = addr->priv->iter->next;
+      return g_object_ref (sockaddr);
     }
-  return sockaddr;
 }
 
 static void
@@ -380,6 +380,7 @@ got_addresses (GObject      *source_object,
   GNetworkAddress *addr;
   GList *addresses;
   GError *error = NULL;
+  GSocketAddress *sockaddr;
 
   addr = (GNetworkAddress *)g_async_result_get_source_object (G_ASYNC_RESULT (simple));
   /* get_source_object adds a ref */
@@ -397,6 +398,10 @@ got_addresses (GObject      *source_object,
       addr->priv->iter = addr->priv->sockaddrs;
     }
 
+  sockaddr = g_network_address_connectable_get_next (G_SOCKET_CONNECTABLE (addr), NULL, NULL);
+  if (sockaddr)
+    g_simple_async_result_set_op_res_gpointer (simple, sockaddr, g_object_unref);
+
   g_simple_async_result_complete (simple);
   g_object_unref (simple);
 }
@@ -409,6 +414,7 @@ g_network_address_connectable_get_next_async (GSocketConnectable   *connectable,
 {
   GNetworkAddress *addr = G_NETWORK_ADDRESS (connectable);
   GSimpleAsyncResult *simple;
+  GSocketAddress *sockaddr;
 
   simple = g_simple_async_result_new (G_OBJECT (connectable),
                                       callback, user_data,
@@ -426,6 +432,10 @@ g_network_address_connectable_get_next_async (GSocketConnectable   *connectable,
     }
   else
     {
+      sockaddr = g_network_address_connectable_get_next (connectable, NULL, NULL);
+      if (sockaddr)
+        g_simple_async_result_set_op_res_gpointer (simple, sockaddr, g_object_unref);
+
       g_simple_async_result_complete_in_idle (simple);
       g_object_unref (simple);
     }
@@ -436,20 +446,11 @@ g_network_address_connectable_get_next_finish (GSocketConnectable  *connectable,
                                                GAsyncResult        *result,
                                                GError             **error)
 {
-  GNetworkAddress *addr = G_NETWORK_ADDRESS (connectable);
   GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (result);
   GSocketAddress *sockaddr;
 
-  if (g_simple_async_result_propagate_error (simple, error))
-    sockaddr = NULL;
-  else if (!addr->priv->iter)
-    sockaddr = NULL;
-  else
-    {
-      sockaddr = addr->priv->iter->data;
-      addr->priv->iter = addr->priv->iter->next;
-    }
-  return sockaddr;
+  sockaddr = g_simple_async_result_get_op_res_gpointer (simple);
+  return sockaddr ? g_object_ref (sockaddr) : NULL;
 }
 
 static void
diff --git a/gio/gnetworkservice.c b/gio/gnetworkservice.c
index d32f562..b23619b 100644
--- a/gio/gnetworkservice.c
+++ b/gio/gnetworkservice.c
@@ -115,13 +115,7 @@ g_network_service_finalize (GObject *object)
   g_free (srv->priv->domain);
 
   if (srv->priv->targets)
-    {
-      GList *t;
-
-      for (t = srv->priv->targets; t; t = t->next)
-        g_object_unref (t->data);
-      g_list_free (srv->priv->targets);
-    }
+    g_resolver_free_targets (srv->priv->targets);
 
   g_object_unref (srv->priv->resolver);
   g_network_service_connectable_reset ((GSocketConnectable *)srv);
@@ -316,17 +310,6 @@ g_network_service_get_domain (GNetworkService *srv)
   return srv->priv->domain;
 }
 
-static void
-free_addresses (GNetworkService *srv)
-{
-  GList *a;
-
-  for (a = srv->priv->addrs; a; a = a->next)
-    g_object_unref (a->data);
-  g_list_free (srv->priv->addrs);
-  srv->priv->addrs = NULL;
-}
-
 static GSocketAddress *
 g_network_service_connectable_get_next (GSocketConnectable  *connectable,
                                         GCancellable        *cancellable,
@@ -415,7 +398,8 @@ g_network_service_connectable_get_next (GSocketConnectable  *connectable,
 
   if (!srv->priv->addr_iter)
     {
-      free_addresses (srv);
+      g_resolver_free_addresses (srv->priv->addrs);
+      srv->priv->addrs = NULL;
       srv->priv->target_iter = srv->priv->target_iter->next;
     }
 
@@ -584,12 +568,13 @@ get_next_async_have_addresses (GNetworkService *srv)
   srv->priv->addr_iter = srv->priv->addr_iter->next;
   if (!srv->priv->addr_iter)
     {
-      free_addresses (srv);
+      g_resolver_free_addresses (srv->priv->addrs);
+      srv->priv->addrs = NULL;
       srv->priv->target_iter = srv->priv->target_iter->next;
     }
 
   srv->priv->next_result = NULL;
-  g_simple_async_result_set_op_res_gpointer (simple, sockaddr, NULL);
+  g_simple_async_result_set_op_res_gpointer (simple, sockaddr, g_object_unref);
   g_simple_async_result_complete_in_idle (simple);
   g_object_unref (simple);
 }
@@ -600,9 +585,10 @@ g_network_service_connectable_get_next_finish (GSocketConnectable  *connectable,
                                                GError             **error)
 {
   GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (result);
+  GSocketAddress *sockaddr;
 
-  g_simple_async_result_propagate_error (simple, error);
-  return g_simple_async_result_get_op_res_gpointer (simple);
+  sockaddr = g_simple_async_result_get_op_res_gpointer (simple);
+  return sockaddr ? g_object_ref (sockaddr) : NULL;
 }
 
 static void
@@ -610,7 +596,8 @@ g_network_service_connectable_reset (GSocketConnectable  *connectable)
 {
   GNetworkService *srv = G_NETWORK_SERVICE (connectable);
 
-  free_addresses (srv);
+  g_resolver_free_addresses (srv->priv->addrs);
+  srv->priv->addrs = NULL;
   srv->priv->target_iter = srv->priv->targets;
   if (srv->priv->iter_error)
     {
diff --git a/gio/gresolver.c b/gio/gresolver.c
index 2094781..ef046bc 100644
--- a/gio/gresolver.c
+++ b/gio/gresolver.c
@@ -178,7 +178,7 @@ g_resolver_set_default (GResolver *resolver)
  *
  * Return value: a #GList of #GInetAddress, or %NULL on error. You
  * must unref each of the addresses and free the list when you are
- * done with it.
+ * done with it. (You can use g_resolver_free_addresses() to do this.)
  *
  * Since: 2.20
  **/
@@ -250,7 +250,7 @@ g_resolver_lookup_by_name_async (GResolver           *resolver,
                                           g_resolver_lookup_by_name_async);
 
       addrs = g_list_append (NULL, addr);
-      g_simple_async_result_set_op_res_gpointer (simple, addrs, NULL);
+      g_simple_async_result_set_op_res_gpointer (simple, addrs, (GDestroyNotify)g_resolver_free_addresses);
       g_simple_async_result_complete_in_idle (simple);
       g_object_unref (simple);
       return;
@@ -290,15 +290,21 @@ g_resolver_lookup_by_name_finish (GResolver     *resolver,
 {
   g_return_val_if_fail (G_IS_RESOLVER (resolver), NULL);
 
-  /* Handle the stringified-IP-addr case */
   if (G_IS_SIMPLE_ASYNC_RESULT (result))
     {
       GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (result);
 
+      if (g_simple_async_result_propagate_error (simple, error))
+        return NULL;
+
+      /* Handle the stringified-IP-addr case */
       if (g_simple_async_result_get_source_tag (simple) == g_resolver_lookup_by_name_async)
         {
-          g_simple_async_result_propagate_error (simple, error);
-          return g_simple_async_result_get_op_res_gpointer (simple);
+          GList *addrs;
+
+          addrs = g_simple_async_result_get_op_res_gpointer (simple);
+          g_simple_async_result_set_op_res_gpointer (simple, NULL, NULL);
+          return addrs;
         }
     }
 
@@ -307,6 +313,25 @@ g_resolver_lookup_by_name_finish (GResolver     *resolver,
 }
 
 /**
+ * g_resolver_free_addresses:
+ * @addresses: a #GList of #GInetAddress
+ *
+ * Frees @addresses (which should be the return value from
+ * g_resolver_lookup_by_name() or g_resolver_lookup_by_name_finish()).
+ * (This is a convenience method; you can also simply free the results
+ * by hand.)
+ **/
+void
+g_resolver_free_addresses (GList *addresses)
+{
+  GList *a;
+
+  for (a = addresses; a; a = a->next)
+    g_object_unref (a->data);
+  g_list_free (addresses);
+}
+
+/**
  * g_resolver_lookup_by_address:
  * @resolver: a #GResolver
  * @address: the address to reverse-resolve
@@ -394,6 +419,14 @@ g_resolver_lookup_by_address_finish (GResolver     *resolver,
 {
   g_return_val_if_fail (G_IS_RESOLVER (resolver), NULL);
 
+  if (G_IS_SIMPLE_ASYNC_RESULT (result))
+    {
+      GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (result);
+
+      if (g_simple_async_result_propagate_error (simple, error))
+        return NULL;
+    }
+
   return G_RESOLVER_GET_CLASS (resolver)->
     lookup_by_address_finish (resolver, result, error);
 }
@@ -448,6 +481,7 @@ g_resolver_get_service_rrname (const char *service,
  *
  * Return value: a #GList of #GSrvTarget, or %NULL on error. You must
  * free each of the targets and the list when you are done with it.
+ * (You can use g_resolver_free_targets() to do this.)
  *
  * Since: 2.20
  **/
@@ -543,11 +577,38 @@ g_resolver_lookup_service_finish (GResolver     *resolver,
 {
   g_return_val_if_fail (G_IS_RESOLVER (resolver), NULL);
 
+  if (G_IS_SIMPLE_ASYNC_RESULT (result))
+    {
+      GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (result);
+
+      if (g_simple_async_result_propagate_error (simple, error))
+        return NULL;
+    }
+
   return G_RESOLVER_GET_CLASS (resolver)->
     lookup_service_finish (resolver, result, error);
 }
 
 /**
+ * g_resolver_free_targets:
+ * @targets: a #GList of #GSrvTarget
+ *
+ * Frees @targets (which should be the return value from
+ * g_resolver_lookup_service() or g_resolver_lookup_service_finish()).
+ * (This is a convenience method; you can also simply free the
+ * results by hand.)
+ **/
+void
+g_resolver_free_targets (GList *targets)
+{
+  GList *t;
+
+  for (t = targets; t; t = t->next)
+    g_srv_target_free (t->data);
+  g_list_free (targets);
+}
+
+/**
  * g_resolver_error_quark:
  * 
  * Gets the #GResolver Error Quark.
@@ -631,7 +692,7 @@ _g_resolver_address_to_sockaddr (GInetAddress            *address,
 
   sockaddr = g_inet_socket_address_new (address, 0);
   g_socket_address_to_native (sockaddr, (struct sockaddr *)sa, sizeof (*sa));
-  *sa_len = g_socket_address_native_size (sockaddr);
+  *sa_len = g_socket_address_get_native_size (sockaddr);
   g_object_unref (sockaddr);
 }
 
diff --git a/gio/gresolver.h b/gio/gresolver.h
index 79bd4d4..788851e 100644
--- a/gio/gresolver.h
+++ b/gio/gresolver.h
@@ -110,6 +110,8 @@ GList     *g_resolver_lookup_by_name_finish     (GResolver            *resolver,
 						 GAsyncResult         *result,
 						 GError              **error);
 
+void       g_resolver_free_addresses            (GList                *addresses);
+
 gchar     *g_resolver_lookup_by_address         (GResolver            *resolver,
 						 GInetAddress         *address,
 						 GCancellable         *cancellable,
@@ -140,6 +142,8 @@ GList     *g_resolver_lookup_service_finish     (GResolver            *resolver,
 						 GAsyncResult         *result,
 						 GError              **error);
 
+void       g_resolver_free_targets              (GList                *targets);
+
 /**
  * G_RESOLVER_ERROR:
  *
diff --git a/gio/gsocketaddress.c b/gio/gsocketaddress.c
index 3a94d0c..46ed928 100644
--- a/gio/gsocketaddress.c
+++ b/gio/gsocketaddress.c
@@ -1,4 +1,4 @@
-/* GNIO - GLib Network Layer of GIO
+/* GIO - GLib Input, Output and Streaming Library
  *
  * Copyright (C) 2008 Christian Kellner, Samuel Cormier-Iijima
  *
@@ -84,7 +84,7 @@ g_socket_address_init (GSocketAddress *address)
 }
 
 /**
- * g_socket_address_native_size:
+ * g_socket_address_get_native_size:
  * @address: a #GSocketAddress
  *
  * Gets the size of @address's native <type>struct sockaddr</type>.
@@ -95,11 +95,11 @@ g_socket_address_init (GSocketAddress *address)
  * @address represents
  */
 gssize
-g_socket_address_native_size (GSocketAddress *address)
+g_socket_address_get_native_size (GSocketAddress *address)
 {
   g_return_val_if_fail (G_IS_SOCKET_ADDRESS (address), -1);
 
-  return G_SOCKET_ADDRESS_GET_CLASS (address)->native_size (address);
+  return G_SOCKET_ADDRESS_GET_CLASS (address)->get_native_size (address);
 }
 
 /**
@@ -108,7 +108,7 @@ g_socket_address_native_size (GSocketAddress *address)
  * @dest: a pointer to a memory location that will contain the native
  * <type>struct sockaddr</type>.
  * @destlen: the size of @dest. Must be at least as large as
- * g_socket_address_native_size().
+ * g_socket_address_get_native_size().
  *
  * Converts a #GSocketAddress to a native <type>struct
  * sockaddr</type>, which can be passed to low-level functions like
@@ -201,7 +201,7 @@ g_socket_address_connectable_get_next (GSocketConnectable  *connectable,
       g_object_set_data (G_OBJECT (connectable),
 			 "GSocketConnectable-iterated",
 			 GINT_TO_POINTER (TRUE));
-      return G_SOCKET_ADDRESS (connectable);
+      return g_object_ref (connectable);
     }
 }
 
diff --git a/gio/gsocketaddress.h b/gio/gsocketaddress.h
index bbb9b2f..48882b5 100644
--- a/gio/gsocketaddress.h
+++ b/gio/gsocketaddress.h
@@ -50,11 +50,11 @@ struct _GSocketAddressClass
 {
   GObjectClass parent_class;
 
-  gssize   (*native_size) (GSocketAddress *address);
+  gssize   (*get_native_size) (GSocketAddress *address);
 
-  gboolean (*to_native)   (GSocketAddress *address,
-			   gpointer        dest,
-			   gsize           destlen);
+  gboolean (*to_native)       (GSocketAddress *address,
+			       gpointer        dest,
+			       gsize           destlen);
 };
 
 GType           g_socket_address_get_type        (void) G_GNUC_CONST;
@@ -66,7 +66,7 @@ gboolean        g_socket_address_to_native       (GSocketAddress *address,
 						  gpointer        dest,
 						  gsize           destlen);
 
-gssize          g_socket_address_native_size     (GSocketAddress *address);
+gssize          g_socket_address_get_native_size (GSocketAddress *address);
 
 G_END_DECLS
 
diff --git a/gio/gsocketconnectable.c b/gio/gsocketconnectable.c
index 361cde1..c72dd7c 100644
--- a/gio/gsocketconnectable.c
+++ b/gio/gsocketconnectable.c
@@ -151,7 +151,7 @@ g_socket_connectable_real_get_next_async (GSocketConnectable  *connectable,
 				      g_socket_connectable_real_get_next_async);
   address = g_socket_connectable_get_next (connectable, cancellable, &error);
   if (address)
-    g_simple_async_result_set_op_res_gpointer (result, address, NULL);
+    g_simple_async_result_set_op_res_gpointer (result, address, g_object_unref);
   else if (error)
     {
       g_simple_async_result_set_from_error (result, error);
@@ -193,15 +193,13 @@ g_socket_connectable_real_get_next_finish (GSocketConnectable  *connectable,
 					   GError             **error)
 {
   GSimpleAsyncResult *simple;
+  GSocketAddress *sockaddr;
 
-  g_return_val_if_fail (G_IS_SIMPLE_ASYNC_RESULT (result), NULL);
+  g_return_val_if_fail (g_simple_async_result_is_valid (result, G_OBJECT (connectable), g_socket_connectable_real_get_next_async), NULL);
   simple = G_SIMPLE_ASYNC_RESULT (result);
-  g_return_val_if_fail (g_simple_async_result_get_source_tag (simple) == g_socket_connectable_real_get_next_async, NULL);
 
-  if (g_simple_async_result_propagate_error (simple, error))
-    return NULL;
-  else
-    return g_simple_async_result_get_op_res_gpointer (simple);
+  sockaddr = g_simple_async_result_get_op_res_gpointer (simple);
+  return sockaddr ? g_object_ref (sockaddr) : NULL;
 }
 
 /**
@@ -228,6 +226,14 @@ g_socket_connectable_get_next_finish (GSocketConnectable  *connectable,
 
   g_return_val_if_fail (G_IS_SOCKET_CONNECTABLE (connectable), NULL);
 
+  if (G_IS_SIMPLE_ASYNC_RESULT (result))
+    {
+      GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (result);
+
+      if (g_simple_async_result_propagate_error (simple, error))
+	return NULL;
+    }
+
   iface = G_SOCKET_CONNECTABLE_GET_IFACE (connectable);
 
   return (* iface->get_next_finish) (connectable, result, error);
diff --git a/gio/gthreadedresolver.c b/gio/gthreadedresolver.c
index 8cf1938..0440a3d 100644
--- a/gio/gthreadedresolver.c
+++ b/gio/gthreadedresolver.c
@@ -138,9 +138,12 @@ finalize (GObject *object)
 
 typedef struct _GThreadedResolverRequest GThreadedResolverRequest;
 typedef void (*GThreadedResolverResolveFunc) (GThreadedResolverRequest *, GError **);
+typedef void (*GThreadedResolverFreeFunc) (GThreadedResolverRequest *);
 
 struct _GThreadedResolverRequest {
   GThreadedResolverResolveFunc resolve_func;
+  GThreadedResolverFreeFunc free_func;
+
   union {
     struct {
       gchar *hostname;
@@ -174,12 +177,14 @@ static void request_cancelled_disconnect_notify (gpointer req, GClosure *closure
 
 static GThreadedResolverRequest *
 g_threaded_resolver_request_new (GThreadedResolverResolveFunc  resolve_func,
+                                 GThreadedResolverFreeFunc     free_func,
 				 GCancellable                 *cancellable)
 {
   GThreadedResolverRequest *req;
 
   req = g_slice_new0 (GThreadedResolverRequest);
   req->resolve_func = resolve_func;
+  req->free_func = free_func;
 
   /* Initial refcount is 2; one for the caller and one for resolve_func */
   req->ref_count = 2;
@@ -220,6 +225,9 @@ g_threaded_resolver_request_unref (GThreadedResolverRequest *req)
   if (req->error)
     g_error_free (req->error);
 
+  if (req->free_func)
+    req->free_func (req);
+
   /* We don't have to free req->cancellable or req->async_result,
    * since (if set), they must already have been freed by
    * request_complete() in order to get here.
@@ -348,14 +356,9 @@ resolve_finish (GResolver     *resolver,
 		gpointer       tag,
                 GError       **error)
 {
-  GSimpleAsyncResult *simple;
-
-  g_return_val_if_fail (G_IS_SIMPLE_ASYNC_RESULT (result), FALSE);
-  simple = G_SIMPLE_ASYNC_RESULT (result);
-  g_return_val_if_fail (g_simple_async_result_get_source_tag (simple) == tag, FALSE);
+  g_return_val_if_fail (g_simple_async_result_is_valid (result, G_OBJECT (resolver), tag), NULL);
 
-  g_simple_async_result_propagate_error (simple, error);
-  return g_simple_async_result_get_op_res_gpointer (simple);
+  return g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (result));
 }
 
 static void
@@ -383,7 +386,7 @@ lookup_by_name (GResolver     *resolver,
   GThreadedResolverRequest *req;
   GList *addresses;
 
-  req = g_threaded_resolver_request_new (do_lookup_by_name, cancellable);
+  req = g_threaded_resolver_request_new (do_lookup_by_name, NULL, cancellable);
   req->u.name.hostname = (gchar *)hostname;
   resolve_sync (gtr, req, error);
 
@@ -393,6 +396,14 @@ lookup_by_name (GResolver     *resolver,
 }
 
 static void
+free_lookup_by_name (GThreadedResolverRequest *req)
+{
+  g_free (req->u.name.hostname);
+  if (req->u.name.addresses)
+    g_resolver_free_addresses (req->u.name.addresses);
+}
+
+static void
 lookup_by_name_async (GResolver           *resolver,
                       const gchar         *hostname,
                       GCancellable        *cancellable,
@@ -402,7 +413,8 @@ lookup_by_name_async (GResolver           *resolver,
   GThreadedResolver *gtr = G_THREADED_RESOLVER (resolver);
   GThreadedResolverRequest *req;
 
-  req = g_threaded_resolver_request_new (do_lookup_by_name, cancellable);
+  req = g_threaded_resolver_request_new (do_lookup_by_name, free_lookup_by_name,
+                                         cancellable);
   req->u.name.hostname = g_strdup (hostname);
   resolve_async (gtr, req, callback, user_data, lookup_by_name_async);
 }
@@ -417,8 +429,7 @@ lookup_by_name_finish (GResolver     *resolver,
 
   req = resolve_finish (resolver, result, lookup_by_name_async, error);
   addresses = req->u.name.addresses;
-  g_free (req->u.name.hostname);
-  g_threaded_resolver_request_unref (req);
+  req->u.name.addresses = NULL;
   return addresses;
 }
 
@@ -451,7 +462,7 @@ lookup_by_address (GResolver        *resolver,
   GThreadedResolverRequest *req;
   gchar *name;
 
-  req = g_threaded_resolver_request_new (do_lookup_by_address, cancellable);
+  req = g_threaded_resolver_request_new (do_lookup_by_address, NULL, cancellable);
   req->u.address.address = address;
   resolve_sync (gtr, req, error);
 
@@ -461,6 +472,14 @@ lookup_by_address (GResolver        *resolver,
 }
 
 static void
+free_lookup_by_address (GThreadedResolverRequest *req)
+{
+  g_object_unref (req->u.address.address);
+  if (req->u.address.name)
+    g_free (req->u.address.name);
+}
+
+static void
 lookup_by_address_async (GResolver           *resolver,
                          GInetAddress        *address,
                          GCancellable        *cancellable,
@@ -470,7 +489,9 @@ lookup_by_address_async (GResolver           *resolver,
   GThreadedResolver *gtr = G_THREADED_RESOLVER (resolver);
   GThreadedResolverRequest *req;
 
-  req = g_threaded_resolver_request_new (do_lookup_by_address, cancellable);
+  req = g_threaded_resolver_request_new (do_lookup_by_address,
+                                         free_lookup_by_address,
+                                         cancellable);
   req->u.address.address = g_object_ref (address);
   resolve_async (gtr, req, callback, user_data, lookup_by_address_async);
 }
@@ -485,8 +506,7 @@ lookup_by_address_finish (GResolver     *resolver,
 
   req = resolve_finish (resolver, result, lookup_by_address_async, error);
   name = req->u.address.name;
-  g_object_unref (req->u.address.address);
-  g_threaded_resolver_request_unref (req);
+  req->u.address.name = NULL;
   return name;
 }
 
@@ -525,7 +545,7 @@ lookup_service (GResolver        *resolver,
   GThreadedResolverRequest *req;
   GList *targets;
 
-  req = g_threaded_resolver_request_new (do_lookup_service, cancellable);
+  req = g_threaded_resolver_request_new (do_lookup_service, NULL, cancellable);
   req->u.service.rrname = (char *)rrname;
   resolve_sync (gtr, req, error);
 
@@ -535,6 +555,14 @@ lookup_service (GResolver        *resolver,
 }
 
 static void
+free_lookup_service (GThreadedResolverRequest *req)
+{
+  g_free (req->u.service.rrname);
+  if (req->u.service.targets)
+    g_resolver_free_targets (req->u.service.targets);
+}
+
+static void
 lookup_service_async (GResolver           *resolver,
                       const char          *rrname,
 		      GCancellable        *cancellable,
@@ -544,7 +572,9 @@ lookup_service_async (GResolver           *resolver,
   GThreadedResolver *gtr = G_THREADED_RESOLVER (resolver);
   GThreadedResolverRequest *req;
 
-  req = g_threaded_resolver_request_new (do_lookup_service, cancellable);
+  req = g_threaded_resolver_request_new (do_lookup_service,
+                                         free_lookup_service,
+                                         cancellable);
   req->u.service.rrname = g_strdup (rrname);
   resolve_async (gtr, req, callback, user_data, lookup_service_async);
 }
@@ -559,8 +589,7 @@ lookup_service_finish (GResolver     *resolver,
 
   req = resolve_finish (resolver, result, lookup_service_async, error);
   targets = req->u.service.targets;
-  g_free (req->u.service.rrname);
-  g_threaded_resolver_request_unref (req);
+  req->u.service.targets = NULL;
   return targets;
 }
 
diff --git a/gio/gunixresolver.c b/gio/gunixresolver.c
index 35a04c6..36bb046 100644
--- a/gio/gunixresolver.c
+++ b/gio/gunixresolver.c
@@ -108,7 +108,10 @@ g_unix_resolver_finalize (GObject *object)
  *    after the async_result completes.
  */
 
-typedef struct {
+typedef struct _GUnixResolverRequest GUnixResolverRequest;
+typedef void (*GUnixResolverFreeFunc) (GUnixResolverRequest *);
+
+struct _GUnixResolverRequest {
   GUnixResolver *gur;
 
   _g_asyncns_query_t *qy;
@@ -117,27 +120,30 @@ typedef struct {
     GInetAddress *address;
     gchar *service;
   } u;
+  GUnixResolverFreeFunc free_func;
 
   GCancellable *cancellable;
   GSimpleAsyncResult *async_result;
 
-} GUnixResolverRequest;
+};
 
 static void g_unix_resolver_request_free (GUnixResolverRequest *req);
 static void request_cancelled (GCancellable *cancellable,
                                gpointer      user_data);
 
 static GUnixResolverRequest *
-g_unix_resolver_request_new (GUnixResolver      *gur,
-                             _g_asyncns_query_t *qy,
-                             GCancellable       *cancellable,
-                             GSimpleAsyncResult *async_result)
+g_unix_resolver_request_new (GUnixResolver         *gur,
+                             _g_asyncns_query_t    *qy,
+                             GUnixResolverFreeFunc  free_func,
+                             GCancellable          *cancellable,
+                             GSimpleAsyncResult    *async_result)
 {
   GUnixResolverRequest *req;
 
   req = g_slice_new0 (GUnixResolverRequest);
   req->gur = g_object_ref (gur);
   req->qy = qy;
+  req->free_func = free_func;
 
   if (cancellable)
     {
@@ -156,6 +162,10 @@ g_unix_resolver_request_new (GUnixResolver      *gur,
 static void
 g_unix_resolver_request_free (GUnixResolverRequest *req)
 {
+  /* If the user didn't call _finish the qy will still be around. */
+  if (req->qy)
+    _g_asyncns_cancel (req->gur->asyncns, req->qy);
+
   /* We don't have to free req->cancellable and req->async_result,
    * since they must already have been freed if we're here.
    */
@@ -232,18 +242,19 @@ g_unix_resolver_watch (GIOChannel   *iochannel,
 }
 
 static GUnixResolverRequest *
-resolve_async (GUnixResolver       *gur,
-               _g_asyncns_query_t  *qy,
-               GCancellable        *cancellable,
-               GAsyncReadyCallback  callback,
-               gpointer             user_data,
-               gpointer             tag)
+resolve_async (GUnixResolver         *gur,
+               _g_asyncns_query_t    *qy,
+               GUnixResolverFreeFunc  free_func,
+               GCancellable          *cancellable,
+               GAsyncReadyCallback    callback,
+               gpointer               user_data,
+               gpointer               tag)
 {
   GSimpleAsyncResult *result;
   GUnixResolverRequest *req;
 
   result = g_simple_async_result_new (G_OBJECT (gur), callback, user_data, tag);
-  req = g_unix_resolver_request_new (gur, qy, cancellable, result);
+  req = g_unix_resolver_request_new (gur, qy, free_func, cancellable, result);
   g_object_unref (result);
   _g_asyncns_setuserdata (gur->asyncns, qy, req);
 
@@ -251,6 +262,12 @@ resolve_async (GUnixResolver       *gur,
 }
 
 static void
+lookup_by_name_free (GUnixResolverRequest *req)
+{
+  g_free (req->u.hostname);
+}
+
+static void
 lookup_by_name_async (GResolver           *resolver,
                       const gchar         *hostname,
                       GCancellable        *cancellable,
@@ -263,7 +280,7 @@ lookup_by_name_async (GResolver           *resolver,
 
   qy = _g_asyncns_getaddrinfo (gur->asyncns, hostname, NULL,
                                &_g_resolver_addrinfo_hints);
-  req = resolve_async (gur, qy, cancellable,
+  req = resolve_async (gur, qy, lookup_by_name_free, cancellable,
                        callback, user_data, lookup_by_name_async);
   req->u.hostname = g_strdup (hostname);
 }
@@ -279,20 +296,13 @@ lookup_by_name_finish (GResolver     *resolver,
   gint retval;
   GList *addresses;
 
-  g_return_val_if_fail (G_IS_SIMPLE_ASYNC_RESULT (result), FALSE);
+  g_return_val_if_fail (g_simple_async_result_is_valid (result, G_OBJECT (resolver), lookup_by_name_async), FALSE);
   simple = G_SIMPLE_ASYNC_RESULT (result);
-  g_return_val_if_fail (g_simple_async_result_get_source_tag (simple) == lookup_by_name_async, FALSE);
-
-  if (g_simple_async_result_propagate_error (simple, error))
-    {
-      g_free (req->u.hostname);
-      return FALSE;
-    }
 
   req = g_simple_async_result_get_op_res_gpointer (simple);
   retval = _g_asyncns_getaddrinfo_done (req->gur->asyncns, req->qy, &res);
+  req->qy = NULL;
   addresses = _g_resolver_addresses_from_addrinfo (req->u.hostname, res, retval, error);
-  g_free (req->u.hostname);
   if (res)
     freeaddrinfo (res);
 
@@ -301,6 +311,12 @@ lookup_by_name_finish (GResolver     *resolver,
 
 
 static void
+lookup_by_address_free (GUnixResolverRequest *req)
+{
+  g_object_unref (req->u.address);
+}
+
+static void
 lookup_by_address_async (GResolver           *resolver,
                          GInetAddress        *address,
                          GCancellable        *cancellable,
@@ -317,7 +333,7 @@ lookup_by_address_async (GResolver           *resolver,
   qy = _g_asyncns_getnameinfo (gur->asyncns,
                                (struct sockaddr *)&sockaddr, sockaddr_size,
                                NI_NAMEREQD, TRUE, FALSE);
-  req = resolve_async (gur, qy, cancellable,
+  req = resolve_async (gur, qy, lookup_by_address_free, cancellable,
                        callback, user_data, lookup_by_address_async);
   req->u.address = g_object_ref (address);
 }
@@ -332,27 +348,26 @@ lookup_by_address_finish (GResolver     *resolver,
   gchar host[NI_MAXHOST], *name;
   gint retval;
 
-  g_return_val_if_fail (G_IS_SIMPLE_ASYNC_RESULT (result), FALSE);
+  g_return_val_if_fail (g_simple_async_result_is_valid (result, G_OBJECT (resolver), lookup_by_address_async), FALSE);
   simple = G_SIMPLE_ASYNC_RESULT (result);
-  g_return_val_if_fail (g_simple_async_result_get_source_tag (simple) == lookup_by_address_async, FALSE);
-
-  if (g_simple_async_result_propagate_error (simple, error))
-    {
-      g_object_unref (req->u.address);
-      return FALSE;
-    }
 
   req = g_simple_async_result_get_op_res_gpointer (simple);
   retval = _g_asyncns_getnameinfo_done (req->gur->asyncns, req->qy,
                                         host, sizeof (host), NULL, 0);
+  req->qy = NULL;
   name = _g_resolver_name_from_nameinfo (req->u.address, host, retval, error);
-  g_object_unref (req->u.address);
 
   return name;
 }
 
 
 static void
+lookup_service_free (GUnixResolverRequest *req)
+{
+  g_free (req->u.service);
+}
+
+static void
 lookup_service_async (GResolver           *resolver,
                       const char          *rrname,
 		      GCancellable        *cancellable,
@@ -364,7 +379,7 @@ lookup_service_async (GResolver           *resolver,
   _g_asyncns_query_t *qy;
 
   qy = _g_asyncns_res_query (gur->asyncns, rrname, C_IN, T_SRV);
-  req = resolve_async (gur, qy, cancellable,
+  req = resolve_async (gur, qy, lookup_service_free, cancellable,
                        callback, user_data, lookup_service_async);
   req->u.service = g_strdup (rrname);
 }
@@ -380,18 +395,12 @@ lookup_service_finish (GResolver     *resolver,
   gint len, herr;
   GList *targets;
 
-  g_return_val_if_fail (G_IS_SIMPLE_ASYNC_RESULT (result), FALSE);
+  g_return_val_if_fail (g_simple_async_result_is_valid (result, G_OBJECT (resolver), lookup_service_async), FALSE);
   simple = G_SIMPLE_ASYNC_RESULT (result);
-  g_return_val_if_fail (g_simple_async_result_get_source_tag (simple) == lookup_service_async, FALSE);
-
-  if (g_simple_async_result_propagate_error (simple, error))
-    {
-      g_free (req->u.service);
-      return FALSE;
-    }
 
   req = g_simple_async_result_get_op_res_gpointer (simple);
   len = _g_asyncns_res_done (req->gur->asyncns, req->qy, &answer);
+  req->qy = NULL;
   if (len < 0)
     herr = h_errno;
   else
@@ -400,7 +409,6 @@ lookup_service_finish (GResolver     *resolver,
   targets = _g_resolver_targets_from_res_query (req->u.service, answer, len, herr, error);
   _g_asyncns_freeanswer (answer);
 
-  g_free (req->u.service);
   return targets;
 }
 
diff --git a/gio/gunixsocketaddress.c b/gio/gunixsocketaddress.c
index 93d946f..8b31904 100644
--- a/gio/gunixsocketaddress.c
+++ b/gio/gunixsocketaddress.c
@@ -1,4 +1,4 @@
-/* GNIO - GLib Network Layer of GIO
+/* GIO - GLib Input, Output and Streaming Library
  *
  * Copyright (C) 2008 Christian Kellner, Samuel Cormier-Iijima
  *
@@ -117,7 +117,7 @@ g_unix_socket_address_set_property (GObject      *object,
 }
 
 static gssize
-g_unix_socket_address_native_size (GSocketAddress *address)
+g_unix_socket_address_get_native_size (GSocketAddress *address)
 {
   return sizeof (struct sockaddr_un);
 }
@@ -154,7 +154,7 @@ g_unix_socket_address_class_init (GUnixSocketAddressClass *klass)
   gobject_class->get_property = g_unix_socket_address_get_property;
 
   gsocketaddress_class->to_native = g_unix_socket_address_to_native;
-  gsocketaddress_class->native_size = g_unix_socket_address_native_size;
+  gsocketaddress_class->get_native_size = g_unix_socket_address_get_native_size;
 
   g_object_class_install_property (gobject_class,
                                    PROP_PATH,
diff --git a/gio/gwin32resolver.c b/gio/gwin32resolver.c
index e84afe4..8d57133 100644
--- a/gio/gwin32resolver.c
+++ b/gio/gwin32resolver.c
@@ -276,12 +276,8 @@ lookup_by_name_finish (GResolver     *resolver,
   GSimpleAsyncResult *simple;
   GWin32ResolverRequest *req;
 
-  g_return_val_if_fail (G_IS_SIMPLE_ASYNC_RESULT (result), FALSE);
+  g_return_val_if_fail (g_simple_async_result_is_valid (result, G_OBJECT (resolver), lookup_by_name_async), NULL);
   simple = G_SIMPLE_ASYNC_RESULT (result);
-  g_return_val_if_fail (g_simple_async_result_get_source_tag (simple) == lookup_by_name_async, FALSE);
-
-  if (g_simple_async_result_propagate_error (simple, error))
-    return FALSE;
 
   req = g_simple_async_result_get_op_res_gpointer (simple);
   return _g_resolver_addresses_from_addrinfo (req->u.name.name, req->u.name.res,
@@ -330,7 +326,7 @@ lookup_by_address_async (GResolver           *resolver,
   QueueUserWorkItem (lookup_by_addresses_in_thread, req, 0);
 }
 
-static gboolean
+static char *
 lookup_by_address_finish (GResolver     *resolver,
                           GAsyncResult  *result,
                           GError       **error)
@@ -338,12 +334,8 @@ lookup_by_address_finish (GResolver     *resolver,
   GSimpleAsyncResult *simple;
   GWin32ResolverRequest *req;
 
-  g_return_val_if_fail (G_IS_SIMPLE_ASYNC_RESULT (result), FALSE);
+  g_return_val_if_fail (g_simple_async_result_is_valid (result, G_OBJECT (resolver), lookup_by_address_async), NULL);
   simple = G_SIMPLE_ASYNC_RESULT (result);
-  g_return_val_if_fail (g_simple_async_result_get_source_tag (simple) == lookup_by_address_async, FALSE);
-
-  if (g_simple_async_result_propagate_error (simple, error))
-    return FALSE;
 
   req = g_simple_async_result_get_op_res_gpointer (simple);
   return _g_resolver_name_from_nameinfo (req->u.address.iaddr,
@@ -397,12 +389,8 @@ lookup_service_finish (GResolver     *resolver,
   GSimpleAsyncResult *simple;
   GWin32ResolverRequest *req;
 
-  g_return_val_if_fail (G_IS_SIMPLE_ASYNC_RESULT (result), FALSE);
+  g_return_val_if_fail (g_simple_async_result_is_valid (result, G_OBJECT (resolver), lookup_service_async), NULL);
   simple = G_SIMPLE_ASYNC_RESULT (result);
-  g_return_val_if_fail (g_simple_async_result_get_source_tag (simple) == lookup_service_async, FALSE);
-
-  if (g_simple_async_result_propagate_error (simple, error))
-    return FALSE;
 
   req = g_simple_async_result_get_op_res_gpointer (simple);
   return _g_resolver_targets_from_DnsQuery (req->u.service.rrname,
diff --git a/gio/tests/resolver.c b/gio/tests/resolver.c
index 044eed2..4f0b71b 100644
--- a/gio/tests/resolver.c
+++ b/gio/tests/resolver.c
@@ -323,6 +323,8 @@ do_sync_connectable (GSocketConnectable *connectable)
 
   while ((sockaddr = g_socket_connectable_get_next (connectable, cancellable, &error)))
     print_connectable_sockaddr (sockaddr, error);
+
+  g_object_unref (connectable);
   done_lookup ();
 }
 
@@ -341,7 +343,10 @@ got_next_async (GObject *source, GAsyncResult *result, gpointer user_data)
   if (sockaddr)
     do_async_connectable (connectable);
   else
-    done_lookup ();
+    {
+      g_object_unref (connectable);
+      done_lookup ();
+    }
 }
 
 static void
