summaryrefslogtreecommitdiff
path: root/examples/simplechat
diff options
context:
space:
mode:
Diffstat (limited to 'examples/simplechat')
-rw-r--r--examples/simplechat/chatserver.cpp5
1 files changed, 1 insertions, 4 deletions
diff --git a/examples/simplechat/chatserver.cpp b/examples/simplechat/chatserver.cpp
index 0ca4b47..e341a76 100644
--- a/examples/simplechat/chatserver.cpp
+++ b/examples/simplechat/chatserver.cpp
@@ -65,10 +65,7 @@ ChatServer::ChatServer(quint16 port, QObject *parent) :
ChatServer::~ChatServer()
{
m_pWebSocketServer->close();
- while (!m_clients.isEmpty()) {
- QWebSocket *pWebSocket = m_clients.takeFirst();
- delete pWebSocket;
- }
+ qDeleteAll(m_clients.begin(), m_clients.end());
}
//! [constructor]