From 7ff131d7af8c220411b8082775fc49020b412a93 Mon Sep 17 00:00:00 2001 From: Klaus Basan Date: Sun, 13 May 2018 13:49:08 +0200 Subject: [PATCH] Fix isntall component, use copy of filename as the referenced var can be out of scope already --- src/blackgui/components/installxswiftbuscomponent.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/blackgui/components/installxswiftbuscomponent.cpp b/src/blackgui/components/installxswiftbuscomponent.cpp index 8c29cc36d..2446b0bb9 100644 --- a/src/blackgui/components/installxswiftbuscomponent.cpp +++ b/src/blackgui/components/installxswiftbuscomponent.cpp @@ -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); });