From 730a5a994ff46055055c58b25bd059373dddb934 Mon Sep 17 00:00:00 2001 From: Frederik Gladhorn Date: Thu, 18 Oct 2012 19:31:59 +0200 Subject: Accessibility: make sure right objects are cached on linux MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The linux test would actually fail because the qobjects created could end up having the same address (create-delete-create...). After an object is deleted, it's not instantly removed from the cache of valid objects. Instead it would stay in the list with it's smart pointer becoming zero. This patch adds the missing null pointer check so we are always up to date. Change-Id: Ia7be14741d4798c2b8e75cb7127298c73cf206ef Reviewed-by: Jan Arve Sæther --- src/platformsupport/linuxaccessibility/atspiadaptor.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/platformsupport/linuxaccessibility/atspiadaptor.cpp b/src/platformsupport/linuxaccessibility/atspiadaptor.cpp index bea84d04fb..54ecf537f2 100644 --- a/src/platformsupport/linuxaccessibility/atspiadaptor.cpp +++ b/src/platformsupport/linuxaccessibility/atspiadaptor.cpp @@ -1540,7 +1540,7 @@ QString AtSpiAdaptor::pathForInterface(const QAIPointer &interface, bool inDestr quintptr uintptr = reinterpret_cast(interfaceWithObject->object()); path.prepend(QLatin1String(QSPI_OBJECT_PATH_PREFIX) + QString::number(uintptr)); - if (!inDestructor && !m_handledObjects.contains(uintptr)) + if (!inDestructor && (!m_handledObjects.contains(uintptr) || m_handledObjects.value(uintptr) == 0)) m_handledObjects[uintptr] = QPointer(interfaceWithObject->object()); return path; -- cgit v1.2.3