loudmouth/lm-resolver.c
changeset 712 ba47719252ad
parent 690 7ccf2113ec5f
child 725 05fa3e01e5b1
child 726 ea6aaf57f344
equal deleted inserted replaced
711:f9e84b075afa 712:ba47719252ad
    59     LmResolverResult    result;
    59     LmResolverResult    result;
    60     struct addrinfo    *results;
    60     struct addrinfo    *results;
    61     struct addrinfo    *current_result;
    61     struct addrinfo    *current_result;
    62 };
    62 };
    63 
    63 
       
    64 static void     resolver_dispose             (GObject           *object);
    64 static void     resolver_finalize            (GObject           *object);
    65 static void     resolver_finalize            (GObject           *object);
    65 static void     resolver_get_property        (GObject           *object,
    66 static void     resolver_get_property        (GObject           *object,
    66                                               guint              param_id,
    67                                               guint              param_id,
    67                                               GValue            *value,
    68                                               GValue            *value,
    68                                               GParamSpec        *pspec);
    69                                               GParamSpec        *pspec);
    87 static void
    88 static void
    88 lm_resolver_class_init (LmResolverClass *class)
    89 lm_resolver_class_init (LmResolverClass *class)
    89 {
    90 {
    90     GObjectClass *object_class = G_OBJECT_CLASS (class);
    91     GObjectClass *object_class = G_OBJECT_CLASS (class);
    91 
    92 
       
    93     object_class->dispose      = resolver_dispose;
    92     object_class->finalize     = resolver_finalize;
    94     object_class->finalize     = resolver_finalize;
    93     object_class->get_property = resolver_get_property;
    95     object_class->get_property = resolver_get_property;
    94     object_class->set_property = resolver_set_property;
    96     object_class->set_property = resolver_set_property;
    95 
    97 
    96     g_object_class_install_property (object_class,
    98     g_object_class_install_property (object_class,
   156 }
   158 }
   157 
   159 
   158 static void
   160 static void
   159 lm_resolver_init (LmResolver *resolver)
   161 lm_resolver_init (LmResolver *resolver)
   160 {
   162 {
   161     (void) GET_PRIV (resolver);
   163 }
       
   164 
       
   165 static void
       
   166 resolver_dispose (GObject *object)
       
   167 {
       
   168     LmResolverPriv *priv = GET_PRIV (object);
       
   169 
       
   170     if (priv->context) {
       
   171         g_main_context_unref (priv->context);
       
   172         priv->context = NULL;
       
   173     }
       
   174 
       
   175     (G_OBJECT_CLASS (lm_resolver_parent_class)->dispose) (object);
   162 }
   176 }
   163 
   177 
   164 static void
   178 static void
   165 resolver_finalize (GObject *object)
   179 resolver_finalize (GObject *object)
   166 {
   180 {
   170 
   184 
   171     g_free (priv->host);
   185     g_free (priv->host);
   172     g_free (priv->domain);
   186     g_free (priv->domain);
   173     g_free (priv->service);
   187     g_free (priv->service);
   174     g_free (priv->protocol);
   188     g_free (priv->protocol);
   175 
       
   176     if (priv->context) {
       
   177         g_main_context_unref (priv->context);
       
   178     }
       
   179 
   189 
   180     if (priv->results) {
   190     if (priv->results) {
   181         freeaddrinfo (priv->results);
   191         freeaddrinfo (priv->results);
   182     }
   192     }
   183 
   193