From faefc2e0da94911b628a56b7274c96e980189928 Mon Sep 17 00:00:00 2001 From: Manuel Nickschas Date: Fri, 22 Nov 2013 00:39:29 +0100 Subject: [PATCH] Don't crash after displaying a connection error popup Error popups are modal dialogs running a nested event loop, which means that events will continue to be processed while the popup is showing. In this particular case, the socket would close, and the authhandler calling the popup synchronously would be deleted, leading to a segfault when closing the popup. Making this a queued connection prevents this from happening, as control is not going to be returned to the deleted authhandler that way. --- src/client/coreconnection.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client/coreconnection.cpp b/src/client/coreconnection.cpp index 7725d861..d077e247 100644 --- a/src/client/coreconnection.cpp +++ b/src/client/coreconnection.cpp @@ -456,7 +456,7 @@ void CoreConnection::connectToCurrentAccount() connect(_authHandler, SIGNAL(requestDisconnect(QString,bool)), SLOT(disconnectFromCore(QString,bool))); connect(_authHandler, SIGNAL(errorMessage(QString)), SIGNAL(connectionError(QString))); - connect(_authHandler, SIGNAL(errorPopup(QString)), SIGNAL(connectionErrorPopup(QString))); + connect(_authHandler, SIGNAL(errorPopup(QString)), SIGNAL(connectionErrorPopup(QString)), Qt::QueuedConnection); connect(_authHandler, SIGNAL(statusMessage(QString)), SIGNAL(connectionMsg(QString))); connect(_authHandler, SIGNAL(encrypted(bool)), SIGNAL(encrypted(bool))); connect(_authHandler, SIGNAL(startCoreSetup(QVariantList)), SIGNAL(startCoreSetup(QVariantList))); -- 2.20.1