From 03ecaab2590ab82e3d14dccb24ea4056a7930bbe Mon Sep 17 00:00:00 2001 From: Kevin Ottens Date: Wed, 17 Jun 2020 12:29:14 +0200 Subject: [PATCH] Capture the pointer to info by value Using a reference capture is a disaster waiting to happen here, if for some reason we'd move from exec() to popup() for the menu below we'd be getting garbage in the lambda call. Signed-off-by: Kevin Ottens --- src/gui/accountsettings.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/accountsettings.cpp b/src/gui/accountsettings.cpp index 8b0a36c6f..20b02a15b 100644 --- a/src/gui/accountsettings.cpp +++ b/src/gui/accountsettings.cpp @@ -559,7 +559,7 @@ void AccountSettings::slotSubfolderContextMenuRequested(const QModelIndex& index if (!isEncrypted) { ac = menu.addAction(tr("Encrypt")); - connect(ac, &QAction::triggered, [this, &info] { slotMarkSubfolderEncrypted(info); }); + connect(ac, &QAction::triggered, [this, info] { slotMarkSubfolderEncrypted(info); }); } else { // Ingore decrypting for now since it only works with an empty folder // connect(ac, &QAction::triggered, [this, &info] { slotMarkSubfolderDecrypted(info); }); -- 2.30.2