diff --git a/src/plugins/debugger/debuggerruncontrol.cpp b/src/plugins/debugger/debuggerruncontrol.cpp index 8468cd40032..555a44a8a58 100644 --- a/src/plugins/debugger/debuggerruncontrol.cpp +++ b/src/plugins/debugger/debuggerruncontrol.cpp @@ -1110,23 +1110,23 @@ DebugServerPortsGatherer::DebugServerPortsGatherer(RunControl *runControl) setId("DebugServerPortsGatherer"); auto portsGatherer = new PortsGatherer(runControl); - for (int i = 0; i < 2; ++i) { - auto channelProvider = new Internal::SubChannelProvider(runControl, portsGatherer); - m_channelProviders[i] = channelProvider; - addStartDependency(channelProvider); - } + m_gdbChannelProvider = new Internal::SubChannelProvider(runControl, portsGatherer); + addStartDependency(m_gdbChannelProvider); + + m_qmlChannelProvider = new Internal::SubChannelProvider(runControl, portsGatherer); + addStartDependency(m_qmlChannelProvider); } DebugServerPortsGatherer::~DebugServerPortsGatherer() = default; QUrl DebugServerPortsGatherer::gdbServer() const { - return m_channelProviders[0]->channel(); + return m_gdbChannelProvider->channel(); } QUrl DebugServerPortsGatherer::qmlServer() const { - return m_channelProviders[1]->channel(); + return m_qmlChannelProvider->channel(); } void DebuggerRunTool::startDebugServerIfNeededAndContinueStartup() diff --git a/src/plugins/debugger/debuggerruncontrol.h b/src/plugins/debugger/debuggerruncontrol.h index db5658a2e87..91a987bece3 100644 --- a/src/plugins/debugger/debuggerruncontrol.h +++ b/src/plugins/debugger/debuggerruncontrol.h @@ -142,9 +142,10 @@ public: QUrl qmlServer() const; private: - std::array m_channelProviders; bool m_useGdbServer = false; bool m_useQmlServer = false; + Internal::SubChannelProvider *m_gdbChannelProvider; + Internal::SubChannelProvider *m_qmlChannelProvider; }; class DebuggerRunWorkerFactory final : public ProjectExplorer::RunWorkerFactory