diff options
author | Thomas Senyk <thomas.senyk@qt.io> | 2023-11-30 15:09:34 +0100 |
---|---|---|
committer | Thomas Senyk <thomas.senyk@qt.io> | 2024-01-18 15:35:32 +0100 |
commit | acce7bc40d287eff826cd97dbea595da3050669f (patch) | |
tree | 8f03a1ebdda4e79a01695ee4fd793f9c17f16b08 /src/hardwareintegration/compositor/wayland-egl/waylandeglclientbufferintegration.cpp | |
parent | 5085fa08226ff58543359ccf4e6cc34176d7d252 (diff) |
client texture cleanup: fix crash in clean-up lambda
The dtor of WaylandEgl[Stream]ClientBuffer used to only clean-up
the aboutToBeDestroyed-connection/lambda if it's integration is still
present.
This was a pointless condition as that clean-up is not
depending on the integration and can lead to access of
dead memory (when the Buffer is already deleted but the lambda is
then later called due to QOpenGLContext::aboutToBeDestroyed)
Fixed by moving the clean-up into it's own scope
(needs a scope due to QMutexLocker)
Pick-to: 6.7 6.6 6.5
Change-Id: Ib3b6e54365f66484f249ee449cb3b27029f5ce7c
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Diffstat (limited to 'src/hardwareintegration/compositor/wayland-egl/waylandeglclientbufferintegration.cpp')
-rw-r--r-- | src/hardwareintegration/compositor/wayland-egl/waylandeglclientbufferintegration.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/hardwareintegration/compositor/wayland-egl/waylandeglclientbufferintegration.cpp b/src/hardwareintegration/compositor/wayland-egl/waylandeglclientbufferintegration.cpp index 38b0e0c4b..c8819ba1f 100644 --- a/src/hardwareintegration/compositor/wayland-egl/waylandeglclientbufferintegration.cpp +++ b/src/hardwareintegration/compositor/wayland-egl/waylandeglclientbufferintegration.cpp @@ -525,7 +525,9 @@ WaylandEglClientBuffer::~WaylandEglClientBuffer() if (d->egl_stream) p->funcs->destroy_stream(p->egl_display, d->egl_stream); + } + { QMutexLocker locker(&d->texturesLock); for (int i=0; i<3; i++) { |