diff options
author | Itay Grudev <itay+github.com@grudev.com> | 2021-11-24 11:18:53 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-24 11:18:53 +0200 |
commit | 3d7c1ea7bb86675688f2a4ded7b435603069a5ad (patch) | |
tree | 1549614660c337f9ba979326379d12c39c85aeb6 | |
parent | Merge pull request #140 from itay-grudev/itay-grudev-patch-1 (diff) | |
parent | Fix crash when sending ack on removed connection (diff) | |
download | singleapplication-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.cpp | 4 |
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 ) |