mirror of
https://github.com/overte-org/overte.git
synced 2025-04-16 10:28:57 +02:00
make sure DS log handler is cleaned up
This commit is contained in:
parent
9d2e1773a0
commit
493a9da43e
3 changed files with 22 additions and 7 deletions
|
@ -68,6 +68,8 @@ DomainServer::DomainServer(int argc, char* argv[]) :
|
|||
LogUtils::init();
|
||||
Setting::init();
|
||||
|
||||
connect(this, &QCoreApplication::aboutToQuit, this, &DomainServer::aboutToQuit);
|
||||
|
||||
setOrganizationName("High Fidelity");
|
||||
setOrganizationDomain("highfidelity.io");
|
||||
setApplicationName("domain-server");
|
||||
|
@ -106,6 +108,11 @@ DomainServer::DomainServer(int argc, char* argv[]) :
|
|||
}
|
||||
}
|
||||
|
||||
void DomainServer::aboutToQuit() {
|
||||
// clear the log handler so that Qt doesn't call the destructor on LogHandler
|
||||
qInstallMessageHandler(0);
|
||||
}
|
||||
|
||||
void DomainServer::restart() {
|
||||
qDebug() << "domain-server is restarting.";
|
||||
|
||||
|
@ -558,7 +565,6 @@ const NodeSet STATICALLY_ASSIGNED_NODES = NodeSet() << NodeType::AudioMixer
|
|||
<< NodeType::AvatarMixer << NodeType::EntityServer;
|
||||
|
||||
void DomainServer::handleConnectRequest(const QByteArray& packet, const HifiSockAddr& senderSockAddr) {
|
||||
|
||||
NodeType_t nodeType;
|
||||
HifiSockAddr publicSockAddr, localSockAddr;
|
||||
|
||||
|
@ -1341,10 +1347,14 @@ void DomainServer::pingPunchForConnectingPeer(const SharedNetworkPeer& peer) {
|
|||
}
|
||||
|
||||
void DomainServer::handlePeerPingTimeout() {
|
||||
SharedNetworkPeer senderPeer = _icePeers.value(qobject_cast<NetworkPeer*>(sender())->getUUID());
|
||||
NetworkPeer* senderPeer = qobject_cast<NetworkPeer*>(sender());
|
||||
|
||||
if (senderPeer && !senderPeer->getActiveSocket()) {
|
||||
pingPunchForConnectingPeer(senderPeer);
|
||||
if (senderPeer) {
|
||||
SharedNetworkPeer sharedPeer = _icePeers.value(senderPeer->getUUID());
|
||||
|
||||
if (sharedPeer && !sharedPeer->getActiveSocket()) {
|
||||
pingPunchForConnectingPeer(sharedPeer);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -57,6 +57,8 @@ public slots:
|
|||
void restart();
|
||||
|
||||
private slots:
|
||||
void aboutToQuit();
|
||||
|
||||
void loginFailed();
|
||||
void readAvailableDatagrams();
|
||||
void setupPendingAssignmentCredits();
|
||||
|
|
|
@ -646,10 +646,13 @@ void NodeList::startNodeHolePunch(const SharedNodePointer& node) {
|
|||
}
|
||||
|
||||
void NodeList::handleNodePingTimeout() {
|
||||
SharedNodePointer senderNode = nodeWithUUID(qobject_cast<Node*>(sender())->getUUID());
|
||||
Node* senderNode = qobject_cast<Node*>(sender());
|
||||
if (senderNode) {
|
||||
SharedNodePointer sharedNode = nodeWithUUID(senderNode->getUUID());
|
||||
|
||||
if (senderNode && !senderNode->getActiveSocket()) {
|
||||
pingPunchForInactiveNode(senderNode);
|
||||
if (sharedNode && !sharedNode->getActiveSocket()) {
|
||||
pingPunchForInactiveNode(sharedNode);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue