From 3282887fca59509a3ace6ab5cfd0f21e97e159bd Mon Sep 17 00:00:00 2001 From: Kissaki Date: Thu, 14 May 2015 15:23:06 +0200 Subject: [PATCH] Fix access violations on exit with Overlay active * Prevent duplicate object deletion triggered by disconnect signal upon us deleting an overlay client. --- src/mumble/Overlay.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/mumble/Overlay.cpp b/src/mumble/Overlay.cpp index 4e435c586..42aa9eddb 100644 --- a/src/mumble/Overlay.cpp +++ b/src/mumble/Overlay.cpp @@ -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() {