From eec4b2cc0ea61b2d5c82fa442737d31732e6fe76 Mon Sep 17 00:00:00 2001 From: Jonas Kvinge Date: Mon, 5 Oct 2020 22:05:37 +0200 Subject: [PATCH] Call QLocalSocket::flush() after QLocalSocket::waitForBytesWritten() --- 3rdparty/singleapplication/singleapplication_p.cpp | 4 ++-- 3rdparty/singleapplication/singlecoreapplication_p.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/3rdparty/singleapplication/singleapplication_p.cpp b/3rdparty/singleapplication/singleapplication_p.cpp index f6d3477eb..10965af40 100644 --- a/3rdparty/singleapplication/singleapplication_p.cpp +++ b/3rdparty/singleapplication/singleapplication_p.cpp @@ -277,10 +277,10 @@ bool SingleApplicationPrivate::connectToPrimary(int timeout, ConnectionType conn socket_->write(header); socket_->write(initMsg); + bool result = socket_->waitForBytesWritten(timeout - time.elapsed()); socket_->flush(); - if (socket_->waitForBytesWritten(timeout - time.elapsed())) return true; - return false; + return result; } diff --git a/3rdparty/singleapplication/singlecoreapplication_p.cpp b/3rdparty/singleapplication/singlecoreapplication_p.cpp index 09ed635f6..1ba8ef2bb 100644 --- a/3rdparty/singleapplication/singlecoreapplication_p.cpp +++ b/3rdparty/singleapplication/singlecoreapplication_p.cpp @@ -277,10 +277,10 @@ bool SingleCoreApplicationPrivate::connectToPrimary(int timeout, ConnectionType socket_->write(header); socket_->write(initMsg); + bool result = socket_->waitForBytesWritten(timeout - time.elapsed()); socket_->flush(); - if (socket_->waitForBytesWritten(timeout - time.elapsed())) return true; - return false; + return result; }