From 41651d7dcd62a9400eb6f4f8a8580efe00901efb Mon Sep 17 00:00:00 2001 From: ayandexyz <330287855+ayandexyz@users.noreply.github.com> Date: Tue, 22 Sep 2026 19:53:24 +0530 Subject: [PATCH] io/socket: discard sockets which have failed to connect Fixes future connection attempts. --- changelog/next.md | 1 + src/io/socket.cpp | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/changelog/next.md b/changelog/next.md index 1b5e633..fd39091 100644 --- a/changelog/next.md +++ b/changelog/next.md @@ -12,3 +12,4 @@ - Fixed `NotificationAction.text` not accepting text updates. - Fixed PipeWire route volume writes for devices without a reported volume step. - Fixed a crash when quitting or reloading while a `Loader` was still loading asynchronously. +- Fixed future `Socket` connection attempts after a failed connection attempt. diff --git a/src/io/socket.cpp b/src/io/socket.cpp index 40cfca6..d790e7b 100644 --- a/src/io/socket.cpp +++ b/src/io/socket.cpp @@ -73,6 +73,13 @@ void Socket::onSocketDisconnected() { void Socket::onSocketError(QLocalSocket::LocalSocketError error) { qCWarning(logSocket) << "Socket error for" << this << error; emit this->error(error); + + if (!this->connected) { + QObject::disconnect(this->socket, nullptr, this, nullptr); + this->socket->deleteLater(); + this->socket = nullptr; + this->disconnecting = false; + } } bool Socket::isConnected() const { return this->connected; }