From 77f02471ed263d514c6f6edd170b97d2f6e7b44e Mon Sep 17 00:00:00 2001 From: Michael Weghorn Date: Tue, 3 Jun 2025 10:12:05 +0200 Subject: [PATCH] a11y atspi: Create local variable on stack There is no reason to allocate the OrgA11yAtspiSocketInterface object only used inside AtSpiAdaptor::registerApplication on the heap. Pick-to: 6.10 Change-Id: I2985acb5bd3e2f89c60de2b4ffa77b2a78cb4eff Reviewed-by: Volker Hilsheimer --- src/gui/accessible/linux/atspiadaptor.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/gui/accessible/linux/atspiadaptor.cpp b/src/gui/accessible/linux/atspiadaptor.cpp index 915f104035c..6978d5c0268 100644 --- a/src/gui/accessible/linux/atspiadaptor.cpp +++ b/src/gui/accessible/linux/atspiadaptor.cpp @@ -1543,13 +1543,12 @@ bool AtSpiAdaptor::applicationInterface(QAccessibleInterface *interface, const Q */ void AtSpiAdaptor::registerApplication() { - OrgA11yAtspiSocketInterface *registry; - registry = new OrgA11yAtspiSocketInterface(ATSPI_DBUS_NAME_REGISTRY ""_L1, - ATSPI_DBUS_PATH_ROOT ""_L1, m_dbus->connection()); + OrgA11yAtspiSocketInterface registry(ATSPI_DBUS_NAME_REGISTRY ""_L1, ATSPI_DBUS_PATH_ROOT ""_L1, + m_dbus->connection()); QDBusPendingReply reply; QSpiObjectReference ref = QSpiObjectReference(m_dbus->connection(), QDBusObjectPath(ATSPI_DBUS_PATH_ROOT)); - reply = registry->Embed(ref); + reply = registry.Embed(ref); reply.waitForFinished(); // TODO: make this async if (reply.isValid ()) { const QSpiObjectReference &socket = reply.value(); @@ -1559,7 +1558,6 @@ void AtSpiAdaptor::registerApplication() << reply.error().name() << reply.error().message(); } - delete registry; } // Accessible