# HG changeset patch # User Chris Cannam # Date 1477407115 -3600 # Node ID ac4a9518e1ccd1ef28cf595b0e925429087950ef # Parent b418b583fd3bc622e7ad484b7acc98a7bef87606 Only if server not running diff -r b418b583fd3b -r ac4a9518e1cc vamp-client/ProcessQtTransport.h --- a/vamp-client/ProcessQtTransport.h Tue Oct 25 15:32:41 2016 +0100 +++ b/vamp-client/ProcessQtTransport.h Tue Oct 25 15:51:55 2016 +0100 @@ -30,22 +30,24 @@ m_process = new QProcess(); m_process->setReadChannel(QProcess::StandardOutput); m_process->setProcessChannelMode(QProcess::ForwardedErrorChannel); - m_process->start(QString::fromStdString(processName)); + m_process->start(processName.c_str()); if (!m_process->waitForStarted()) { - QProcess::ProcessError err = m_process->error(); - if (err == QProcess::FailedToStart) { - std::cerr << "Unable to start server process " << processName - << std::endl; - } else if (err == QProcess::Crashed) { - std::cerr << "Server process " << processName - << " crashed on startup" << std::endl; - } else { - std::cerr << "Server process " << processName - << " failed on startup with error code " - << err << std::endl; + if (m_process->state() == QProcess::NotRunning) { + QProcess::ProcessError err = m_process->error(); + if (err == QProcess::FailedToStart) { + std::cerr << "Unable to start server process " + << processName << std::endl; + } else if (err == QProcess::Crashed) { + std::cerr << "Server process " << processName + << " crashed on startup" << std::endl; + } else { + std::cerr << "Server process " << processName + << " failed on startup with error code " + << err << std::endl; + } + delete m_process; + m_process = nullptr; } - delete m_process; - m_process = nullptr; } }