aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorItay Grudev <itay+github.com@grudev.com>2021-11-24 11:18:53 +0200
committerGitHub <noreply@github.com>2021-11-24 11:18:53 +0200
commit3d7c1ea7bb86675688f2a4ded7b435603069a5ad (patch)
tree1549614660c337f9ba979326379d12c39c85aeb6
parentMerge pull request #140 from itay-grudev/itay-grudev-patch-1 (diff)
parentFix crash when sending ack on removed connection (diff)
downloadsingleapplication-3d7c1ea7bb86675688f2a4ded7b435603069a5ad.tar.xz
Merge pull request #143 from deepbluev7/fix-crash-on-ack
Fix crash when sending ack on removed connection
-rw-r--r--singleapplication_p.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/singleapplication_p.cpp b/singleapplication_p.cpp
index 1a061f2..6702b94 100644
--- a/singleapplication_p.cpp
+++ b/singleapplication_p.cpp
@@ -503,12 +503,14 @@ void SingleApplicationPrivate::slotDataAvailable( QLocalSocket *dataSocket, quin
if ( !isFrameComplete( dataSocket ) )
return;
- Q_EMIT q->receivedMessage( instanceId, dataSocket->readAll() );
+ const QByteArray message = dataSocket->readAll();
writeAck( dataSocket );
ConnectionInfo &info = connectionMap[dataSocket];
info.stage = StageConnectedHeader;
+
+ Q_EMIT q->receivedMessage( instanceId, message);
}
void SingleApplicationPrivate::slotClientConnectionClosed( QLocalSocket *closedSocket, quint32 instanceId )