From: Manuel Nickschas Date: Thu, 21 Nov 2013 23:39:29 +0000 (+0100) Subject: Don't crash after displaying a connection error popup X-Git-Tag: 0.10-beta1~92 X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=commitdiff_plain;h=faefc2e0da94911b628a56b7274c96e980189928 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. --- 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)));