Fix isntall component, use copy of filename as the referenced var can be out of scope already

This commit is contained in:
Klaus Basan
2018-05-13 13:49:08 +02:00
parent 4f143539f8
commit 7ff131d7af

View File

@@ -161,9 +161,12 @@ namespace BlackGui
QStringList stdOutAndError;
if (CCompressUtils::zip7Uncompress(destFile.absoluteFilePath(), xSwiftBusDirectory, true, &stdOutAndError))
{
// capture values by copy!
const CStatusMessage msg = CStatusMessage(this, CLogCategory::validation()).info("Uncompressed xSwiftBus in '%1'") << xSwiftBusDirectory;
this->showOverlayMessagesWithConfirmation(msg, false, "Delete downloaded file?", [ & ]
this->showOverlayMessagesWithConfirmation(msg, false, "Delete downloaded file?", [ = ]
{
QFile downloadFile(downloadFileName);
if (!downloadFile.exists()) { return; } // removed in meantime
const bool removed = downloadFile.remove();
Q_UNUSED(removed);
});