diff --git a/src/plugins/valgrind/valgrindtool.cpp b/src/plugins/valgrind/valgrindtool.cpp index fb17d004d901c181164672d49f0ffbbe799beb49..910978caba14a2fd7907eee793086fd98a4d5c5c 100644 --- a/src/plugins/valgrind/valgrindtool.cpp +++ b/src/plugins/valgrind/valgrindtool.cpp @@ -78,8 +78,10 @@ Analyzer::AnalyzerStartParameters ValgrindTool::createStartParameters( ProjectExplorer::DeviceKitInformation::device(runConfiguration->target()->kit()); QTC_ASSERT(device->type() == ProjectExplorer::Constants::DESKTOP_DEVICE_TYPE, return sp); QTcpServer server; - if (!server.listen(QHostAddress::LocalHost) || !server.listen(QHostAddress::LocalHostIPv6)) + if (!server.listen(QHostAddress::LocalHost) && !server.listen(QHostAddress::LocalHostIPv6)) { + qWarning() << "Cannot open port on host for profiling."; return sp; + } sp.connParams.host = server.serverAddress().toString(); sp.connParams.port = server.serverPort(); sp.startMode = Analyzer::StartLocal;