From 4c2f944958e7903ac053593a6357453e7eac712d Mon Sep 17 00:00:00 2001 From: Ievgenii Meshcheriakov Date: Mon, 4 Sep 2023 14:30:10 +0200 Subject: [PATCH] QDBusConnectionPrivate: Remove parent argument This class is reference counted, having a parent would interfere with this reference counting code. Change-Id: I5ab4fdfa74af94d8b760bd3600bd1f828e3d2b91 Reviewed-by: Thiago Macieira --- src/dbus/qdbusconnection_p.h | 2 +- src/dbus/qdbusintegrator.cpp | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/dbus/qdbusconnection_p.h b/src/dbus/qdbusconnection_p.h index 93ff91e190..1b79d3911c 100644 --- a/src/dbus/qdbusconnection_p.h +++ b/src/dbus/qdbusconnection_p.h @@ -159,7 +159,7 @@ public: typedef QHash WatchedServicesHash; // public methods are entry points from other objects - explicit QDBusConnectionPrivate(QObject *parent = nullptr); + QDBusConnectionPrivate(); ~QDBusConnectionPrivate(); void createBusService(); diff --git a/src/dbus/qdbusintegrator.cpp b/src/dbus/qdbusintegrator.cpp index 9b185849f7..da5affe7ed 100644 --- a/src/dbus/qdbusintegrator.cpp +++ b/src/dbus/qdbusintegrator.cpp @@ -301,7 +301,7 @@ static void qDBusNewConnection(DBusServer *server, DBusConnection *connection, v if (serverConnection->anonymousAuthenticationAllowed) q_dbus_connection_set_allow_anonymous(connection, true); - QDBusConnectionPrivate *newConnection = new QDBusConnectionPrivate(serverConnection->parent()); + QDBusConnectionPrivate *newConnection = new QDBusConnectionPrivate; manager->addConnection( "QDBusServer-"_L1 + QString::number(reinterpret_cast(newConnection), 16), @@ -1011,9 +1011,8 @@ void QDBusConnectionPrivate::deliverCall(QObject *object, const QDBusMessage &ms return; } -QDBusConnectionPrivate::QDBusConnectionPrivate(QObject *p) - : QObject(p), - ref(1), +QDBusConnectionPrivate::QDBusConnectionPrivate() + : ref(1), mode(InvalidMode), busService(nullptr), connection(nullptr),