Darwin: Capture 'this' via '&' instead of '=' to fix build with C++20

qdarwinpermissionplugin.mm:37:35: error: implicit capture of 'this'
with a capture default of '=' is deprecated [-Werror,-Wdeprecated-this-capture]

Change-Id: I05afd05f43ddceb88cb5fffd85959b494c29ce6a
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 0990bd49407aac4f96acf78761af1070ff934215)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Thiago Macieira 2024-10-15 13:09:06 -07:00 committed by Qt Cherry-pick Bot
parent 3167b157cd
commit 81b71852fa

View File

@ -28,7 +28,7 @@ void QDarwinPermissionPlugin::requestPermission(const QPermission &permission, c
return;
}
[m_handler requestPermission:permission withCallback:[=](Qt::PermissionStatus status) {
[m_handler requestPermission:permission withCallback:[&](Qt::PermissionStatus status) {
// In case the callback comes in on a secondary thread we need to marshal it
// back to the main thread. And if it doesn't, we still want to propagate it
// via an event, to avoid any GCD locks deadlocking the application on iOS