diff options
author | Nicolas Werner <nicolas.werner@hotmail.de> | 2021-11-24 05:21:30 +0100 |
---|---|---|
committer | Nicolas Werner <nicolas.werner@hotmail.de> | 2021-11-24 05:21:30 +0100 |
commit | 07e187d4d8ccbe31130db7b77d1bce217b33809a (patch) | |
tree | ee2aafe7669031b39591b437529e77c8d1313a2d /third_party | |
parent | Initialize client lazily (diff) | |
download | nheko-07e187d4d8ccbe31130db7b77d1bce217b33809a.tar.xz |
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.
Diffstat (limited to 'third_party')
-rw-r--r-- | third_party/SingleApplication-3.3.0/singleapplication_p.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/third_party/SingleApplication-3.3.0/singleapplication_p.cpp b/third_party/SingleApplication-3.3.0/singleapplication_p.cpp index 13397282..3b6f96fe 100644 --- a/third_party/SingleApplication-3.3.0/singleapplication_p.cpp +++ b/third_party/SingleApplication-3.3.0/singleapplication_p.cpp @@ -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 ) |