diff options
author | Liu Zheng <[email protected]> | 2025-08-20 13:44:46 +0800 |
---|---|---|
committer | Liu Zheng <[email protected]> | 2025-08-21 12:20:30 +0800 |
commit | b40086e00829f5efa2cc2997049e17222af57eca (patch) | |
tree | 8323583f08f65e79b564ee508394e4db4aef7b39 /src/plugins/platforms | |
parent | 28449e220f82206ac8cc05d1b9bf209a0e80d057 (diff) |
Replace private QThreadData::get2() API calls with public Qt APIs
to resolve undefined symbol references when building with UBSan.
The issue occurred because QThreadPrivate symbols are not exported
in non-developer builds, causing link failures with UBSan enabled.
This fix maintains the same thread safety validation while using
only public APIs:
Fixes: QTBUG-123404
Change-Id: Ie73ac47246302f133367f2cd7cab5d8f77f0cfcb
Reviewed-by: Anton Kudryavtsev <[email protected]>
Reviewed-by: David Edmundson <[email protected]>
Diffstat (limited to 'src/plugins/platforms')
-rw-r--r-- | src/plugins/platforms/wayland/qwaylandwindow.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/plugins/platforms/wayland/qwaylandwindow.cpp b/src/plugins/platforms/wayland/qwaylandwindow.cpp index cc32eb4d1e9..08fa4365fae 100644 --- a/src/plugins/platforms/wayland/qwaylandwindow.cpp +++ b/src/plugins/platforms/wayland/qwaylandwindow.cpp @@ -34,7 +34,6 @@ #include <QtCore/QDebug> #include <QtCore/QThread> -#include <QtCore/private/qthread_p.h> #include <QtWaylandClient/private/qwayland-fractional-scale-v1.h> @@ -713,7 +712,7 @@ void QWaylandWindow::applyConfigure() if (!mWaitingToApplyConfigure) return; - Q_ASSERT_X(QThread::currentThreadId() == QThreadData::get2(thread())->threadId.loadRelaxed(), + Q_ASSERT_X(QThread::isMainThread(), "QWaylandWindow::applyConfigure", "not called from main thread"); // If we're mid paint, use an exposeEvent to flush the current frame. @@ -1081,7 +1080,7 @@ Qt::WindowFlags QWaylandWindow::windowFlags() const bool QWaylandWindow::createDecoration() { - Q_ASSERT_X(QThread::currentThreadId() == QThreadData::get2(thread())->threadId.loadRelaxed(), + Q_ASSERT_X(QThread::isMainThread(), "QWaylandWindow::createDecoration", "not called from main thread"); // TODO: client side decorations do not work with Vulkan backend. if (window()->surfaceType() == QSurface::VulkanSurface) |