From cbb02474c16642ee42da9749d64c623b4bbf7e96 Mon Sep 17 00:00:00 2001 From: Allan Bazinet Date: Thu, 5 Sep 2024 14:06:36 -0700 Subject: [PATCH] Ensure proper timer thread affinity Since the APRS client object will be moved to another thread, ensure that its timer has a parent of the APRS client object, so that the timer is properly handled when the thread affinity changes. --- APRSISClient.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/APRSISClient.cpp b/APRSISClient.cpp index cbf7b1cb..89b02b96 100644 --- a/APRSISClient.cpp +++ b/APRSISClient.cpp @@ -8,8 +8,11 @@ const int PACKET_TIMEOUT_SECONDS = 300; -APRSISClient::APRSISClient(QString host, quint16 port, QObject *parent): - QTcpSocket(parent) +APRSISClient::APRSISClient(QString const host, + quint16 const port, + QObject * parent) + : QTcpSocket{parent}, + m_timer {this} { setServer(host, port);