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.
This commit is contained in:
Monroe Clinton 2022-10-01 20:49:27 -04:00 committed by Andreas Kling
parent eb0f5bd65e
commit 086fccc2af
Notes: sideshowbarker 2024-07-17 06:27:12 +09:00

View file

@ -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);
}