Merge pull request #143 from deepbluev7/fix-crash-on-ack

Fix crash when sending ack on removed connection
This commit is contained in:
Itay Grudev 2021-11-24 11:18:53 +02:00 committed by GitHub
commit 3d7c1ea7bb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -503,12 +503,14 @@ void SingleApplicationPrivate::slotDataAvailable( QLocalSocket *dataSocket, quin
if ( !isFrameComplete( dataSocket ) ) if ( !isFrameComplete( dataSocket ) )
return; return;
Q_EMIT q->receivedMessage( instanceId, dataSocket->readAll() ); const QByteArray message = dataSocket->readAll();
writeAck( dataSocket ); writeAck( dataSocket );
ConnectionInfo &info = connectionMap[dataSocket]; ConnectionInfo &info = connectionMap[dataSocket];
info.stage = StageConnectedHeader; info.stage = StageConnectedHeader;
Q_EMIT q->receivedMessage( instanceId, message);
} }
void SingleApplicationPrivate::slotClientConnectionClosed( QLocalSocket *closedSocket, quint32 instanceId ) void SingleApplicationPrivate::slotClientConnectionClosed( QLocalSocket *closedSocket, quint32 instanceId )