mirror of
https://github.com/itay-grudev/SingleApplication.git
synced 2025-01-15 17:02:06 +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,
|
QObject::connect(nextConnSocket, &QLocalSocket::disconnected, nextConnSocket, &QLocalSocket::deleteLater);
|
||||||
[nextConnSocket, this](){
|
|
||||||
|
QObject::connect(nextConnSocket, &QLocalSocket::destroyed,
|
||||||
|
[nextConnSocket, this](QObject *obj){
|
||||||
|
Q_UNUSED(obj)
|
||||||
connectionMap.remove(nextConnSocket);
|
connectionMap.remove(nextConnSocket);
|
||||||
nextConnSocket->deleteLater();
|
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user