diff --git a/src/client.cpp b/src/client.cpp index 3c39ef2a..10d3afac 100755 --- a/src/client.cpp +++ b/src/client.cpp @@ -665,6 +665,12 @@ void CClient::OnHandledSignal ( int sigNum ) { case SIGINT: case SIGTERM: + // if connected, terminate connection (needed for headless mode) + if ( IsRunning() ) + { + Stop(); + } + // this should trigger OnAboutToQuit QCoreApplication::instance()->exit(); break;