*/
QWebSocketServerPrivate::~QWebSocketServerPrivate()
{
- close();
+ close(true);
m_pTcpServer->deleteLater();
}
/*!
\internal
*/
-void QWebSocketServerPrivate::close()
+void QWebSocketServerPrivate::close(bool aboutToDestroy)
{
Q_Q(QWebSocketServer);
m_pTcpServer->close();
QWebSocketServer::tr("Server closed."));
pWebSocket->deleteLater();
}
- //emit signal via the event queue, so the server gets time
- //to process any hanging events, like flushing buffers aso
- QMetaObject::invokeMethod(q, "closed", Qt::QueuedConnection);
+ if (!aboutToDestroy) {
+ //emit signal via the event queue, so the server gets time
+ //to process any hanging events, like flushing buffers aso
+ QMetaObject::invokeMethod(q, "closed", Qt::QueuedConnection);
+ }
}
/*!
virtual ~QWebSocketServerPrivate();
void init();
- void close();
+ void close(bool aboutToDestroy = false);
QString errorString() const;
bool hasPendingConnections() const;
bool isListening() const;