コード例 #1
0
static void
send_initial_resource_byebye (Resource *resource)
{
        if (!resource->initial_byebye_sent) {
                /* Unannounce before first announce. This is
                   done to minimize the possibility of
                   control points thinking that this is just
                   a reannouncement. */
                resource_byebye (resource);

                resource->initial_byebye_sent = TRUE;
        }
}
コード例 #2
0
/*
 * Free a Resource structure and its contained data
 */
static void
resource_free (Resource *resource)
{
        while (resource->responses)
                discovery_response_free (resource->responses->data);

        if (resource->resource_group->priv->available)
                resource_byebye (resource);

        g_free (resource->usn);
        g_free (resource->target);

        if (resource->target_regex)
                g_regex_unref (resource->target_regex);

        while (resource->locations) {
                g_free (resource->locations->data);
                resource->locations = g_list_delete_link (resource->locations,
                                                         resource->locations);
        }

        g_slice_free (Resource, resource);
}
コード例 #3
0
ファイル: gssdp-resource-group.c プロジェクト: GNOME/gssdp
/*
 * Free a Resource structure and its contained data
 */
static void
resource_free (Resource *resource)
{
        GSSDPResourceGroupPrivate *priv;

        priv = gssdp_resource_group_get_instance_private
                                        (resource->resource_group);
        /* discovery_response_free will take clear of freeing the list
         * elements and data */
        while (resource->responses)
                discovery_response_free (resource->responses->data);

        if (priv->available)
                resource_byebye (resource);

        g_free (resource->usn);
        g_free (resource->target);

        g_clear_pointer (&resource->target_regex, g_regex_unref);
        g_list_free_full (resource->locations, g_free);

        g_slice_free (Resource, resource);
}