From cf4b413fa4a81dbfaaaf50cb52f92ecc0d3c3f2a Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Tue, 9 Dec 2014 14:16:33 -0800 Subject: Make QtDBus unit tests compile with runtime dbus-1 too There's a change in Qt 5.4.0 that makes Qt compile with its own set of D-Bus headers, which means QT_CFLAGS_DBUS may be empty. Thus, we can't compile or link if we're using the actual libdbus-1 API to build the test. This commit makes these unit tests use the same dynamic loading mechanism. Change-Id: I56b2a7320086ef88793f6552cb54ca6224010451 Reviewed-by: Simon Hausmann --- src/dbus/qdbus_symbols_p.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/dbus/qdbus_symbols_p.h') diff --git a/src/dbus/qdbus_symbols_p.h b/src/dbus/qdbus_symbols_p.h index 88c51947ed..0785fea4b4 100644 --- a/src/dbus/qdbus_symbols_p.h +++ b/src/dbus/qdbus_symbols_p.h @@ -107,6 +107,9 @@ DEFINEFUNC(dbus_bool_t , dbus_connection_add_filter, (DBusConnection void *user_data, DBusFreeFunction free_data_function), (connection, function, user_data, free_data_function), return) +DEFINEFUNC(dbus_bool_t , dbus_connection_can_send_type, (DBusConnection *connection, + int type), + (connection, type), return) DEFINEFUNC(void , dbus_connection_close, (DBusConnection *connection), (connection), return) DEFINEFUNC(DBusDispatchStatus , dbus_connection_dispatch, (DBusConnection *connection), -- cgit v1.2.3 From fb166648936410f791ae6e600756d255b4a50545 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Thu, 1 Jan 2015 22:06:18 -0200 Subject: Fix memory leaks with QDBusServer Two serious mistakes: - we need to call dbus_server_free_data_slot as many times as we call dbus_server_allocate_data_slot - we need to delete the d pointer... The changes to the unit tests are simply to cause the used peer connections to be removed so they don't show up in valgrind. Change-Id: I9fd1ada5503db9ba481806c09116874ee81f450d Reviewed-by: Alex Blasche --- src/dbus/qdbus_symbols_p.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/dbus/qdbus_symbols_p.h') diff --git a/src/dbus/qdbus_symbols_p.h b/src/dbus/qdbus_symbols_p.h index 0785fea4b4..4bec3af490 100644 --- a/src/dbus/qdbus_symbols_p.h +++ b/src/dbus/qdbus_symbols_p.h @@ -323,6 +323,8 @@ DEFINEFUNC(void , dbus_pending_call_unref, (DBusPendingCall /* dbus-server.h */ DEFINEFUNC(dbus_bool_t , dbus_server_allocate_data_slot, (dbus_int32_t *slot_p), (slot_p), return) +DEFINEFUNC(void , dbus_server_free_data_slot, (dbus_int32_t *slot_p), + (slot_p), return) DEFINEFUNC(void , dbus_server_disconnect, (DBusServer *server), (server), ) DEFINEFUNC(char* , dbus_server_get_address, (DBusServer *server), -- cgit v1.2.3