Skip to content
Permalink
Browse files

Merge PR #3250: Fixed crashing on disconnect

  • Loading branch information...
davidebeatrici committed Oct 17, 2017
2 parents 04c0578 + c45957d commit d2943a5f019787628e46e5367172d04a874b9f40
Showing with 13 additions and 1 deletion.
  1. +10 −1 src/mumble/ServerHandler.cpp
  2. +3 −0 src/mumble/ServerHandler.h
@@ -110,6 +110,8 @@ ServerHandler::ServerHandler() {
if (hQoS)
Connection::setQoS(hQoS);
#endif

connect(this, SIGNAL(pingRequested()), this, SLOT(sendPingInternal()), Qt::QueuedConnection);
}

ServerHandler::~ServerHandler() {
@@ -447,6 +449,10 @@ void ServerHandler::setSslErrors(const QList<QSslError> &errors) {
}

void ServerHandler::sendPing() {
emit pingRequested();
}

void ServerHandler::sendPingInternal() {
ConnectionPtr connection(cConnection);
if (!connection)
return;
@@ -688,6 +694,9 @@ void ServerHandler::serverConnectionConnected() {
}

qusUdp = new QUdpSocket(this);
if (! qusUdp) {
qFatal("ServerHandler: qusUdp is unexpectedly a null addr");
}
if (g.s.bUdpForceTcpAddr) {
qusUdp->bind(qhaLocal, 0);
} else {
@@ -698,7 +707,7 @@ void ServerHandler::serverConnectionConnected() {
}
}

connect(qusUdp, SIGNAL(readyRead()), this, SLOT(udpReady()));
connect(qusUdp, SIGNAL(readyRead()), this, SLOT(udpReady()), Qt::QueuedConnection);

if (g.s.bQoS) {

@@ -137,6 +137,7 @@ class ServerHandler : public QThread {
signals:
void disconnected(QAbstractSocket::SocketError, QString reason);
void connected();
void pingRequested();
protected slots:
void message(unsigned int, const QByteArray &);
void serverConnectionConnected();
@@ -146,6 +147,8 @@ class ServerHandler : public QThread {
void setSslErrors(const QList<QSslError> &);
void udpReady();
void hostnameResolved();
private slots:
void sendPingInternal();
public slots:
void sendPing();
};

0 comments on commit d2943a5

Please sign in to comment.
You can’t perform that action at this time.