mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-02 15:15:50 +08:00
Guarding QTimer::singelShot operations, avoid to access dangling pointers
This commit is contained in:
committed by
Roland Winklmeier
parent
b5ba4013dd
commit
1b8383bee1
@@ -218,7 +218,12 @@ namespace BlackGui
|
||||
if (reply == QMessageBox::Yes)
|
||||
{
|
||||
const CStatusMessage msg = CStatusMessage(this).info("Using existing file '%1'") << saveAsFile;
|
||||
QTimer::singleShot(100, this, [ = ] { this->downloadedXSwiftBusFile(msg); });
|
||||
const QPointer<CInstallXSwiftBusComponent> guard(this);
|
||||
QTimer::singleShot(100, this, [ = ]
|
||||
{
|
||||
if (guard.isNull()) { return; }
|
||||
this->downloadedXSwiftBusFile(msg);
|
||||
});
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user