diff --git a/src/main.cpp b/src/main.cpp index c5c0190fe..463db7572 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -406,6 +406,12 @@ int main(int argc, char *argv[]) { qtsparkle::LoadTranslations(language); #endif + #ifndef Q_OS_WIN32 + // This is needed to prevent SIGPIPE Errors, which occur under some + // circumstances in RemoteClient. They cause a program termination. + signal(SIGPIPE, SIG_IGN); + #endif + // Icons IconLoader::Init(); diff --git a/src/networkremote/remoteclient.cpp b/src/networkremote/remoteclient.cpp index 6c4306156..acedc2fc8 100644 --- a/src/networkremote/remoteclient.cpp +++ b/src/networkremote/remoteclient.cpp @@ -36,12 +36,13 @@ RemoteClient::RemoteClient(Application* app, QTcpSocket* client) // Connect to the slot IncomingData when receiving data connect(client, SIGNAL(readyRead()), this, SLOT(IncomingData())); + + // Connect the signals to see if an error occured or the client + // was disconnected. connect(client, SIGNAL(disconnected()), this, SLOT(Disconnected())); connect(client, SIGNAL(error(QAbstractSocket::SocketError)), this, SLOT(Error(QAbstractSocket::SocketError))); - signal(SIGPIPE, SIG_IGN); - // Check if we use auth code QSettings s;