Make things inherit from GInitiallyUnowned, some more socket changes
[cascardo/gnio.git] / gnio / ginetsocketaddress.c
index 5913aee..60fe284 100644 (file)
@@ -60,6 +60,8 @@ g_inet_socket_address_dispose (GObject *object)
 {
   GInetSocketAddress *address G_GNUC_UNUSED = G_INET_SOCKET_ADDRESS (object);
 
+  g_object_unref (address->priv->address);
+
   if (G_OBJECT_CLASS (g_inet_socket_address_parent_class)->dispose)
     (*G_OBJECT_CLASS (g_inet_socket_address_parent_class)->dispose) (object);
 }
@@ -92,7 +94,7 @@ g_inet_socket_address_set_property (GObject *object, guint prop_id, const GValue
   switch (prop_id)
     {
       case PROP_ADDRESS:
-        address->priv->address = G_INET_ADDRESS (g_value_get_object (value));
+        address->priv->address = G_INET_ADDRESS (g_object_ref_sink (g_value_get_object (value)));
         break;
 
       case PROP_PORT:
@@ -192,10 +194,9 @@ g_inet_socket_address_init (GInetSocketAddress *address)
 GInetSocketAddress *
 g_inet_socket_address_new (GInetAddress *address, guint16 port)
 {
-  return NULL;
+  return G_INET_SOCKET_ADDRESS (g_object_new (G_TYPE_INET_SOCKET_ADDRESS, "address", address, "port", port, NULL));
 }
 
-
 GInetAddress *
 g_inet_socket_address_get_address (GInetSocketAddress *sockaddr)
 {