Skip to content

Commit

Permalink
Merge pull request #143 from deepbluev7/fix-crash-on-ack
Browse files Browse the repository at this point in the history
Fix crash when sending ack on removed connection
  • Loading branch information
itay-grudev committed Nov 24, 2021
2 parents 0d7b263 + 3650975 commit 3d7c1ea
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion singleapplication_p.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 )
Expand Down

0 comments on commit 3d7c1ea

Please sign in to comment.