diff options
author | Janne Koskinen <janne.p.koskinen@qt.io> | 2020-03-24 14:22:35 +0200 |
---|---|---|
committer | Paul Olav Tvete <paul.tvete@qt.io> | 2020-03-28 10:22:28 +0000 |
commit | d18c29931b0bc889fff66bdbde89133544ba0529 (patch) | |
tree | 9b28968643b4e446a47d7994a34d957825766d9c /src/client/qwaylandwindow_p.h | |
parent | 1089546e8c47b59b42356d1c75651d082ce300dc (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.
Fixes: QTBUG-82914
Change-Id: Ia10b1b4e055eee80f77076137066ecada683ba32
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Diffstat (limited to 'src/client/qwaylandwindow_p.h')
-rw-r--r-- | src/client/qwaylandwindow_p.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/client/qwaylandwindow_p.h b/src/client/qwaylandwindow_p.h index 0369bd0c2..0b664bda0 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> @@ -222,7 +223,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; |