if (i->service_browser)
avahi_s_service_browser_free(i->service_browser);
- dbus_connection_unregister_object_path(server->bus, i->path);
- avahi_free(i->path);
+
+ if (i->path) {
+ dbus_connection_unregister_object_path(server->bus, i->path);
+ avahi_free(i->path);
+ }
+
AVAHI_LLIST_REMOVE(ServiceBrowserInfo, service_browsers, i->client->service_browsers, i);
i->client->n_objects--;
avahi_free(i);
}
-
DBusHandlerResult avahi_dbus_msg_service_browser_impl(DBusConnection *c, DBusMessage *m, void *userdata) {
DBusError error;
ServiceBrowserInfo *i = userdata;
/* Introspection */
if (dbus_message_is_method_call(m, DBUS_INTERFACE_INTROSPECTABLE, "Introspect"))
- return avahi_dbus_handle_introspect(c, m, "ServiceBrowser.Introspect");
+ return avahi_dbus_handle_introspect(c, m, "ServiceBrowser.introspect");
/* Access control */
if (strcmp(dbus_message_get_sender(m), i->client->name))
assert(b);
assert(i);
- i_interface = (int32_t) interface;
- i_protocol = (int32_t) protocol;
- u_flags = (uint32_t) flags;
-
m = dbus_message_new_signal(i->path, AVAHI_DBUS_INTERFACE_SERVICE_BROWSER, avahi_dbus_map_browse_signal_name(event));
if (event == AVAHI_BROWSER_NEW) {
flags |= AVAHI_LOOKUP_RESULT_OUR_OWN;
}
+ i_interface = (int32_t) interface;
+ i_protocol = (int32_t) protocol;
+ u_flags = (uint32_t) flags;
+
if (event == AVAHI_BROWSER_NEW || event == AVAHI_BROWSER_REMOVE) {
assert(name);
assert(type);