]> git.meshlink.io Git - catta/blobdiff - avahi-daemon/dbus-service-browser.c
Replace libglade with GtkBuilder
[catta] / avahi-daemon / dbus-service-browser.c
index dc10b814a197c25e404ee34ac730fb71c74f0621..1515ddfbc164a0c397f19014e78392894c090a60 100644 (file)
@@ -38,8 +38,12 @@ void avahi_dbus_service_browser_free(ServiceBrowserInfo *i) {
 
     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--;
@@ -65,7 +69,7 @@ DBusHandlerResult avahi_dbus_msg_service_browser_impl(DBusConnection *c, DBusMes
 
     /* 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)) 
@@ -101,10 +105,6 @@ void avahi_dbus_service_browser_callback(AvahiSServiceBrowser *b, AvahiIfIndex i
     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) {
@@ -114,6 +114,10 @@ void avahi_dbus_service_browser_callback(AvahiSServiceBrowser *b, AvahiIfIndex i
             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);