mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-22 23:05:36 +08:00
Check Qpointer "myself" in loop
This commit is contained in:
@@ -84,13 +84,18 @@ namespace BlackGui
|
||||
const CGlobalSetup setup = sApp->getGlobalSetup();
|
||||
if (setup.wasLoadedFromWeb())
|
||||
{
|
||||
QPointer<CSetupLoadingDialog> myself(this);
|
||||
QTimer::singleShot(250, this, [ = ]
|
||||
{
|
||||
if (!myself) { return; }
|
||||
const CUrlList bootstrapUrls = setup.getSwiftBootstrapFileUrls();
|
||||
for (const CUrl &url : bootstrapUrls)
|
||||
{
|
||||
const CStatusMessage msg = CNetworkUtils::canConnect(url) ?
|
||||
CStatusMessage(this).info(u"Can connect to '%1'") << url.getFullUrl() : CStatusMessage(this).warning(u"Cannot connect to '%1'") << url.getFullUrl();
|
||||
const bool cc = CNetworkUtils::canConnect(url);
|
||||
if (!myself) { return; } // because of CEventLoop::processEventsUntil
|
||||
const CStatusMessage msg = cc ?
|
||||
CStatusMessage(this).info(u"Can connect to '%1'") << url.getFullUrl() :
|
||||
CStatusMessage(this).warning(u"Cannot connect to '%1'") << url.getFullUrl();
|
||||
ui->comp_Messages->appendStatusMessageToList(msg);
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user