- QMutexLocker locker(&mutex);
-//TODO: not locking the mutex leads to a crash, but at least it stops.
-//TODO: i don't see how this makes a difference
- kDebug(5011) << "stop(): mutex locked";
- m_stopped = true;
+ if(m_stopped)
+ return;
+
+ //also abort listening for connections, should be safe without locking
+ if(listen_port)
+ cl->listenSpecified = false;
+
+ QMutexLocker locker(&mutex);
+ m_stopped = true;