Commit 9673c3ab authored by W. Michael Petullo's avatar W. Michael Petullo
Browse files

Fix some bugs related to the recent DmapMdnsPublisher singleton change



There were some mistakes left over from the DmapMdnsPublisher singleton
change that were identified while working on Rhythmbox. Rhythmbox woud
crash when a user enabled, disabled and then enabled the DAAP plugin.
Signed-off-by: W. Michael Petullo's avatarW. Michael Petullo <mike@flyn.org>
parent 8e91dcd8
......@@ -108,7 +108,10 @@ dmap_mdns_avahi_get_client (void)
void
dmap_mdns_avahi_set_entry_group (AvahiEntryGroup *eg)
{
g_assert (eg == NULL || entry_group == NULL);
/* FIXME: No longer a valid assumption with new multiple-protocol
* per process code. Refactor?
* g_assert (eg == NULL || entry_group == NULL);
*/
g_assert (avahi_entry_group_get_client (eg) == client);
entry_group = eg;
}
......@@ -450,11 +450,21 @@ dmap_mdns_publisher_finalize (GObject *object)
publisher->priv->entry_group = NULL;
}
avahi_client_free (publisher->priv->client);
/* FIXME: dmap_mdns_avahi_get_client() ensures that a client is initialized only
* once during the lifetime of a program. This needs to be changed so that the
* following call works. Otherwise, an application like Rhythmbox will crash if
* a user deactivates and then activates the DAAP plugin. In this case,
* publisher->priv->client will be free'd but will not be allocated in a
* successive call to dmap_mdns_avahi_get_client().
*
* avahi_client_free (publisher->priv->client);
*/
g_slist_foreach (publisher->priv->service, (GFunc) free_service, NULL);
g_slist_free (publisher->priv->service);
publisher_object = NULL;
G_OBJECT_CLASS (dmap_mdns_publisher_parent_class)->finalize (object);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment