Fix access violations on exit with Overlay active

* Prevent duplicate object deletion triggered by disconnect signal upon us
deleting an overlay client.
This commit is contained in:
Kissaki 2015-05-14 15:23:06 +02:00
parent de27cd7b72
commit 3282887fca

View File

@ -128,7 +128,14 @@ Overlay::~Overlay() {
// Need to be deleted first, since destructor references lingering QLocalSockets
foreach(OverlayClient *oc, qlClients)
{
// As we're the one closing the connection, we do not need to be
// notified of disconnects. This is important because on disconnect we
// also remove (and 'delete') the overlay client.
disconnect(oc->qlsSocket, SIGNAL(disconnected()), this, SLOT(disconnected()));
disconnect(oc->qlsSocket, SIGNAL(error(QLocalSocket::LocalSocketError)), this, SLOT(error(QLocalSocket::LocalSocketError)));
delete oc;
}
}
void Overlay::newConnection() {