mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-06 18:25:37 +08:00
Guarding QTimer::singelShot operations, avoid to access dangling pointers
This commit is contained in:
committed by
Roland Winklmeier
parent
b5ba4013dd
commit
1b8383bee1
@@ -50,7 +50,12 @@ namespace BlackGui
|
||||
|
||||
void CDownloadDialog::showAndStartDownloading()
|
||||
{
|
||||
QTimer::singleShot(0, this, [ = ] { ui->comp_Download->triggerDownloadingOfFiles(2500); });
|
||||
const QPointer<CDownloadDialog> guard(this);
|
||||
QTimer::singleShot(0, this, [ = ]
|
||||
{
|
||||
if (guard.isNull()) { return; }
|
||||
ui->comp_Download->triggerDownloadingOfFiles(2500);
|
||||
});
|
||||
this->show();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user