Pass aEvent by value.

It will have changed by the time CallAfter() is executed.

Fixes https://gitlab.com/kicad/code/kicad/issues/12475
This commit is contained in:
Jeff Young 2023-05-03 12:27:32 +01:00
parent 0eac5c6748
commit 7eb099187d
1 changed files with 3 additions and 3 deletions

View File

@ -70,7 +70,7 @@ void SEARCH_PANE_LISTVIEW::GetSelectRowsList( std::vector<long>& aSelectedList )
void SEARCH_PANE_LISTVIEW::OnItemActivated( wxListEvent& aEvent )
{
CallAfter(
[&]()
[=]()
{
m_handler->ActivateItem( aEvent.GetIndex() );
@ -87,7 +87,7 @@ void SEARCH_PANE_LISTVIEW::OnItemActivated( wxListEvent& aEvent )
void SEARCH_PANE_LISTVIEW::OnItemSelected( wxListEvent& aEvent )
{
CallAfter(
[&]()
[=]()
{
std::vector<long> list;
GetSelectRowsList( list );
@ -101,7 +101,7 @@ void SEARCH_PANE_LISTVIEW::OnItemSelected( wxListEvent& aEvent )
void SEARCH_PANE_LISTVIEW::OnItemDeselected( wxListEvent& aEvent )
{
CallAfter(
[&]()
[=]()
{
std::vector<long> list;
GetSelectRowsList( list );