/* Exports all objects managed by @manager on @connection. If @connection is NULL, stops exporting objects.  */
void g_dbus_object_manager_server_set_connection(GDBusObjectManagerServer *manager, GDBusConnection *connection)
/* Exports all objects managed by @manager on @connection. If @connection is NULL, stops exporting objects.  */
void g_dbus_object_manager_server_set_connection(GDBusObjectManagerServer *manager, GDBusConnection *connection)
{
  g_return_if_fail (G_IS_DBUS_OBJECT_MANAGER_SERVER (manager));
  g_return_if_fail (connection == NULL || G_IS_DBUS_CONNECTION (connection));
  g_mutex_lock (&manager->priv->lock);
  if (manager->priv->connection == connection)
    {
      g_mutex_unlock (&manager->priv->lock);
      goto out;
    }
  if (manager->priv->connection != NULL)
    {
      unexport_all (manager, FALSE);
      g_object_unref (manager->priv->connection);
      manager->priv->connection = NULL;
    }
  manager->priv->connection = connection != NULL ? g_object_ref (connection) : NULL;
  if (manager->priv->connection != NULL)
    export_all (manager);
  g_mutex_unlock (&manager->priv->lock);
  g_object_notify (G_OBJECT (manager), "connection");
 out:
  ;
}