mirror of
https://github.com/itay-grudev/SingleApplication.git
synced 2025-01-15 08:52:08 +08:00
Remove ConnectionInfo after socket is destroyed
This leaves the ConnectionInfo in a valid state, even after the socket is disconnected, which could still have a readyRead() signal emitted. Closes #123
This commit is contained in:
parent
451a42d8f9
commit
99cd51d5a2
@ -328,10 +328,12 @@ void SingleApplicationPrivate::slotConnectionEstablished()
|
||||
}
|
||||
);
|
||||
|
||||
QObject::connect(nextConnSocket, &QLocalSocket::disconnected,
|
||||
[nextConnSocket, this](){
|
||||
QObject::connect(nextConnSocket, &QLocalSocket::disconnected, nextConnSocket, &QLocalSocket::deleteLater);
|
||||
|
||||
QObject::connect(nextConnSocket, &QLocalSocket::destroyed,
|
||||
[nextConnSocket, this](QObject *obj){
|
||||
Q_UNUSED(obj)
|
||||
connectionMap.remove(nextConnSocket);
|
||||
nextConnSocket->deleteLater();
|
||||
}
|
||||
);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user