mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-23 19:38:48 +03:00
Fix crash in SingleApplication when other end exits immediately
In those cases the emit might cause the server to remove the connection and we are working with a dangling pointer. We can't call putChar on that, so acknowledge the message immediately and then emit the message.
This commit is contained in:
parent
ff502f306c
commit
07e187d4d8
1 changed files with 2 additions and 2 deletions
|
@ -494,12 +494,12 @@ void SingleApplicationPrivate::slotDataAvailable( QLocalSocket *dataSocket, quin
|
|||
if ( !isFrameComplete( dataSocket ) )
|
||||
return;
|
||||
|
||||
Q_EMIT q->receivedMessage( instanceId, dataSocket->readAll() );
|
||||
|
||||
writeAck( dataSocket );
|
||||
|
||||
ConnectionInfo &info = connectionMap[dataSocket];
|
||||
info.stage = StageConnectedHeader;
|
||||
|
||||
Q_EMIT q->receivedMessage(instanceId, dataSocket->readAll());
|
||||
}
|
||||
|
||||
void SingleApplicationPrivate::slotClientConnectionClosed( QLocalSocket *closedSocket, quint32 instanceId )
|
||||
|
|
Loading…
Reference in a new issue