void avahi_browser_cleanup(AvahiServer *server) {
    AvahiSRecordBrowser *b;
    AvahiSRecordBrowser *n;

    assert(server);

    while (server->need_browser_cleanup) {
        server->need_browser_cleanup = 0;

        for (b = server->record_browsers; b; b = n) {
            n = b->browser_next;

            if (b->dead)
                avahi_s_record_browser_destroy(b);
        }
    }

    if (server->wide_area_lookup_engine)
        avahi_wide_area_cleanup(server->wide_area_lookup_engine);
    avahi_multicast_lookup_engine_cleanup(server->multicast_lookup_engine);
}
void avahi_browser_cleanup(AvahiServer *server) {
    AvahiSRecordBrowser *b;
    AvahiSRecordBrowser *n;

    assert(server);

    while (server->need_browser_cleanup) {
        server->need_browser_cleanup = 0;

        for (b = server->record_browsers; b; b = n) {
            n = b->browser_next;

            if (b->dead)
                avahi_s_record_browser_destroy(b);
        }
    }

    if (server->wide_area_lookup_engine)
        avahi_wide_area_cleanup(server->wide_area_lookup_engine);
    avahi_multicast_lookup_engine_cleanup(server->multicast_lookup_engine);
}