From 086fccc2af949cc4677caf704b8739e3d93376df Mon Sep 17 00:00:00 2001 From: Monroe Clinton Date: Sat, 1 Oct 2022 20:49:27 -0400 Subject: [PATCH] Calendar: Fix crash when changing event date We were capturing by reference which lead to the variables going out of scope even when used in the lambda. Due to this the update_starting_day_range lambda crashes when called. --- Userland/Applications/Calendar/AddEventDialog.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Userland/Applications/Calendar/AddEventDialog.cpp b/Userland/Applications/Calendar/AddEventDialog.cpp index dd7965a952..29f35fd44a 100644 --- a/Userland/Applications/Calendar/AddEventDialog.cpp +++ b/Userland/Applications/Calendar/AddEventDialog.cpp @@ -107,8 +107,8 @@ AddEventDialog::AddEventDialog(Core::DateTime date_time, Window* parent_window) starting_day_combo.set_range(1, days_in_month(year, month + 1)); }; - starting_year_combo.on_change = [&update_starting_day_range](auto) { update_starting_day_range(); }; - starting_month_combo.on_change = [&update_starting_day_range](auto, auto) { update_starting_day_range(); }; + starting_year_combo.on_change = [update_starting_day_range](auto) { update_starting_day_range(); }; + starting_month_combo.on_change = [update_starting_day_range](auto, auto) { update_starting_day_range(); }; event_title_textbox.set_focus(true); }