mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-24 03:58:49 +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 ) )
|
if ( !isFrameComplete( dataSocket ) )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
Q_EMIT q->receivedMessage( instanceId, 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, dataSocket->readAll());
|
||||||
}
|
}
|
||||||
|
|
||||||
void SingleApplicationPrivate::slotClientConnectionClosed( QLocalSocket *closedSocket, quint32 instanceId )
|
void SingleApplicationPrivate::slotClientConnectionClosed( QLocalSocket *closedSocket, quint32 instanceId )
|
||||||
|
|
Loading…
Reference in a new issue