MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / closeResources

Method closeResources

app/src/API/Server.cpp:149–164  ·  view source on GitHub ↗

* @brief Closes all sockets and cleans up resources */

Source from the content-addressed store, hash-verified

147 * @brief Closes all sockets and cleans up resources
148 */
149void API::ServerWorker::closeResources()
150{
151 Q_ASSERT(QThread::currentThread() == thread());
152
153 for (auto* socket : std::as_const(m_sockets)) {
154 if (socket) {
155 socket->abort();
156 socket->deleteLater();
157 }
158 }
159
160 m_sockets.clear();
161 Q_ASSERT(m_sockets.isEmpty());
162
163 Q_EMIT clientCountChanged(0);
164}
165
166/**
167 * @brief Adds a socket to the worker thread

Callers

nothing calls this directly

Calls 3

isEmptyMethod · 0.80
abortMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected