Skip to content

Commit 31e29e6

Browse files
committed
zeroconf/Avahi: call dbus_shutdown() during shutdown
Make valgrind happy.
1 parent dfcb572 commit 31e29e6

File tree

3 files changed

+5
-29
lines changed

3 files changed

+5
-29
lines changed

configure.ac

+1-1
Original file line numberDiff line numberDiff line change
@@ -825,7 +825,7 @@ avahi)
825825
;;
826826
esac
827827

828-
MPD_AUTO_PKG(avahi, AVAHI, [avahi-client],
828+
MPD_AUTO_PKG(avahi, AVAHI, [avahi-client dbus-1],
829829
[avahi client library], [avahi-client not found])
830830
if test x$enable_avahi = xyes; then
831831
AC_DEFINE([HAVE_AVAHI], 1, [Define to enable Avahi Zeroconf support])

src/zeroconf/ZeroconfAvahi.cxx

+4
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@
3434
#include <avahi-common/malloc.h>
3535
#include <avahi-common/error.h>
3636

37+
#include <dbus/dbus.h>
38+
3739
static constexpr Domain avahi_domain("avahi");
3840

3941
static char *avahiName;
@@ -272,4 +274,6 @@ AvahiDeinit(void)
272274

273275
avahi_free(avahiName);
274276
avahiName = nullptr;
277+
278+
dbus_shutdown();
275279
}

valgrind.suppressions

-28
Original file line numberDiff line numberDiff line change
@@ -297,34 +297,6 @@
297297
fun:dlclose
298298
}
299299

300-
# is that a leak in libdbus?
301-
302-
{
303-
<insert a suppression name here>
304-
Memcheck:Leak
305-
fun:?alloc
306-
...
307-
obj:*/libdbus-*.so.*
308-
fun:avahi_client_new
309-
}
310-
311-
{
312-
<insert a suppression name here>
313-
Memcheck:Leak
314-
fun:malloc
315-
obj:/usr/lib/libdbus-1.so.3.4.0
316-
fun:dbus_message_new_error
317-
obj:/usr/lib/libdbus-1.so.3.4.0
318-
fun:dbus_connection_send_with_reply
319-
fun:dbus_connection_send_with_reply_and_block
320-
obj:/usr/lib/libavahi-client.so.3.2.4
321-
fun:avahi_entry_group_new
322-
fun:avahiRegisterService
323-
fun:avahiClientCallback
324-
obj:/usr/lib/libavahi-client.so.3.2.4
325-
fun:avahi_client_new
326-
}
327-
328300
{
329301
inet_ntoa
330302
Memcheck:Leak

0 commit comments

Comments
 (0)