diff options
author | Giuseppe D'Angelo <[email protected]> | 2025-03-25 12:04:35 +0100 |
---|---|---|
committer | Giuseppe D'Angelo <[email protected]> | 2025-03-26 02:04:43 +0100 |
commit | 029407117f0584aea7722ff7702c9f4b83fa9013 (patch) | |
tree | 4a087f8c21319606c7201b1cba6cceffaab4b46b | |
parent | ff14e6fe086731813db336a6b4db18285ebad8b9 (diff) |
Examples: fix UB calls into QElapsedTimer
Calling restart() without start() is illegal, so don't do that; use
start() instead.
Pick-to: 6.9 6.8 6.5
Change-Id: I2ff5151f588cb926ccecc3d9997615e63f36ee24
Reviewed-by: Thiago Macieira <[email protected]>
-rw-r--r-- | examples/corelib/threads/mandelbrot/renderthread.cpp | 2 | ||||
-rw-r--r-- | examples/network/network-chat/connection.cpp | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/examples/corelib/threads/mandelbrot/renderthread.cpp b/examples/corelib/threads/mandelbrot/renderthread.cpp index 77a14a6ac14..b78042cb3a5 100644 --- a/examples/corelib/threads/mandelbrot/renderthread.cpp +++ b/examples/corelib/threads/mandelbrot/renderthread.cpp @@ -81,7 +81,7 @@ void RenderThread::run() constexpr int Limit = 4; bool allBlack = true; - timer.restart(); + timer.start(); for (int y = -halfHeight; y < halfHeight; ++y) { if (restart) diff --git a/examples/network/network-chat/connection.cpp b/examples/network/network-chat/connection.cpp index 54d6a60101e..55e281c440e 100644 --- a/examples/network/network-chat/connection.cpp +++ b/examples/network/network-chat/connection.cpp @@ -237,7 +237,7 @@ void Connection::processData() writer.endMap(); break; case Pong: - pongTime.restart(); + pongTime.start(); break; default: break; |