[gssdp] socket-util: Use g_type_ensure



commit ac5e4e5b5854da9b0f4d79d601651d9bfe653d5d
Author: Jens Georg <mail jensge org>
Date:   Thu Jan 24 11:32:22 2019 +0100

    socket-util: Use g_type_ensure

 libgssdp/gssdp-socket-functions.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/libgssdp/gssdp-socket-functions.c b/libgssdp/gssdp-socket-functions.c
index 042736f..cf94deb 100644
--- a/libgssdp/gssdp-socket-functions.c
+++ b/libgssdp/gssdp-socket-functions.c
@@ -162,8 +162,8 @@ gssdp_socket_enable_info         (GSocket *socket,
 #ifdef HAVE_PKTINFO
         /* Register the type so g_socket_control_message_deserialize() will
          * find it */
-        g_object_unref (g_object_new (GSSDP_TYPE_PKTINFO_MESSAGE, NULL));
-        g_object_unref (g_object_new (GSSDP_TYPE_PKTINFO6_MESSAGE, NULL));
+        g_type_ensure (GSSDP_TYPE_PKTINFO_MESSAGE);
+        g_type_ensure (GSSDP_TYPE_PKTINFO6_MESSAGE);
 
         if (family == G_SOCKET_FAMILY_IPV6) {
                 return gssdp_socket_option_set (socket,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]