mirror of
https://github.com/PrismLauncher/PrismLauncher.git
synced 2025-06-13 05:37:42 +02:00
Always autodelete signal connections with this
captured when the objet is deleted, just to be sure
This commit is contained in:
@ -9,7 +9,7 @@ void ServerPingTask::executeTask() {
|
|||||||
|
|
||||||
// Resolve the actual IP and port for the server
|
// Resolve the actual IP and port for the server
|
||||||
McResolver *resolver = new McResolver(nullptr, m_domain, m_port);
|
McResolver *resolver = new McResolver(nullptr, m_domain, m_port);
|
||||||
QObject::connect(resolver, &McResolver::succeeded, [this, resolver](QString ip, int port) {
|
QObject::connect(resolver, &McResolver::succeeded, this, [this, resolver](QString ip, int port) {
|
||||||
qDebug() << "Resolved Address for" << m_domain << ": " << ip << ":" << port;
|
qDebug() << "Resolved Address for" << m_domain << ": " << ip << ":" << port;
|
||||||
|
|
||||||
// Now that we have the IP and port, query the server
|
// Now that we have the IP and port, query the server
|
||||||
@ -18,7 +18,7 @@ void ServerPingTask::executeTask() {
|
|||||||
|
|
||||||
// Wait for query to finish
|
// Wait for query to finish
|
||||||
QFutureWatcher<int> *watcher = new QFutureWatcher<int>();
|
QFutureWatcher<int> *watcher = new QFutureWatcher<int>();
|
||||||
QObject::connect(watcher, &QFutureWatcher<int>::finished, [this, client, onlineFuture, watcher]() {
|
QObject::connect(watcher, &QFutureWatcher<int>::finished, this, [this, client, onlineFuture, watcher]() {
|
||||||
client->deleteLater();
|
client->deleteLater();
|
||||||
watcher->deleteLater();
|
watcher->deleteLater();
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user