summaryrefslogtreecommitdiffstats
path: root/src/client/qwaylandwindow_p.h
diff options
context:
space:
mode:
authorJanne Koskinen <janne.p.koskinen@qt.io>2020-03-24 14:22:35 +0200
committerEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>2020-04-28 10:30:26 +0200
commitfabaaec60a5fe477f7339c0d825d8b236a7e5330 (patch)
treeccc53f42e6ba2fd41ca8c507ed13535abac38d7e /src/client/qwaylandwindow_p.h
parent4cee861553b32ecc2b1ca134ca33b22af252972e (diff)
Fix leaking of callback timers
Use two timers to create timeout trigger for framecallback. Removes multiple timers approach that is subject to race conditions. This was mistakenly pushed to 5.12 branch which will not be automatically merged upstream, so it has to be cherry-picked. Fixes: QTBUG-82914 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> (cherry picked from commit d18c29931b0bc889fff66bdbde89133544ba0529) Change-Id: I258c0c08f0ac5803192fc0024e40ba72e72c37a8 Reviewed-by: Janne Koskinen <janne.p.koskinen@qt.io>
Diffstat (limited to 'src/client/qwaylandwindow_p.h')
-rw-r--r--src/client/qwaylandwindow_p.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/client/qwaylandwindow_p.h b/src/client/qwaylandwindow_p.h
index 352df89da..ef03fd1f4 100644
--- a/src/client/qwaylandwindow_p.h
+++ b/src/client/qwaylandwindow_p.h
@@ -58,6 +58,7 @@
#include <QtGui/QIcon>
#include <QtCore/QVariant>
#include <QtCore/QLoggingCategory>
+#include <QtCore/QElapsedTimer>
#include <qpa/qplatformwindow.h>
@@ -225,7 +226,8 @@ protected:
WId mWindowId;
bool mWaitingForFrameCallback = false;
bool mFrameCallbackTimedOut = false; // Whether the frame callback has timed out
- QAtomicInt mFrameCallbackTimerId = -1; // Started on commit, reset on frame callback
+ int mFrameCallbackCheckIntervalTimerId = -1;
+ QElapsedTimer mFrameCallbackElapsedTimer;
struct ::wl_callback *mFrameCallback = nullptr;
struct ::wl_event_queue *mFrameQueue = nullptr;
QWaitCondition mFrameSyncWait;