summaryrefslogtreecommitdiff
path: root/examples/echoserver/echoserver.cpp
diff options
context:
space:
mode:
authorKurt Pattyn <pattyn.kurt@gmail.com>2014-02-03 01:34:46 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-02-05 14:03:12 +0100
commit8f41c45d2835d70a29fd64b50194bf617556f46d (patch)
tree88fe4a8c65df8376328b442edb800d75fc039a7d /examples/echoserver/echoserver.cpp
parenta2fd8f50fe268d3f384418073e8fdc07fd258c62 (diff)
downloadqtwebsockets-8f41c45d2835d70a29fd64b50194bf617556f46d.tar.gz
Replace delete loop with qDeleteAll
Change-Id: If63acc08307c0a411072a2a37ac52661e7e02594 Reviewed-by: Milian Wolff <milian.wolff@kdab.com> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
Diffstat (limited to 'examples/echoserver/echoserver.cpp')
-rw-r--r--examples/echoserver/echoserver.cpp5
1 files changed, 1 insertions, 4 deletions
diff --git a/examples/echoserver/echoserver.cpp b/examples/echoserver/echoserver.cpp
index fdfb087..b802f95 100644
--- a/examples/echoserver/echoserver.cpp
+++ b/examples/echoserver/echoserver.cpp
@@ -64,10 +64,7 @@ EchoServer::EchoServer(quint16 port, QObject *parent) :
EchoServer::~EchoServer()
{
m_pWebSocketServer->close();
- while (!m_clients.isEmpty()) {
- QWebSocket *pWebSocket = m_clients.takeFirst();
- delete pWebSocket;
- }
+ qDeleteAll(m_clients.begin(), m_clients.end());
}
//! [onNewConnection]