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 6931252ed9
commit ff8fae377c
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 ) void SEARCH_PANE_LISTVIEW::OnItemActivated( wxListEvent& aEvent )
{ {
CallAfter( CallAfter(
[&]() [=]()
{ {
m_handler->ActivateItem( aEvent.GetIndex() ); m_handler->ActivateItem( aEvent.GetIndex() );
@ -87,7 +87,7 @@ void SEARCH_PANE_LISTVIEW::OnItemActivated( wxListEvent& aEvent )
void SEARCH_PANE_LISTVIEW::OnItemSelected( wxListEvent& aEvent ) void SEARCH_PANE_LISTVIEW::OnItemSelected( wxListEvent& aEvent )
{ {
CallAfter( CallAfter(
[&]() [=]()
{ {
std::vector<long> list; std::vector<long> list;
GetSelectRowsList( list ); GetSelectRowsList( list );
@ -101,7 +101,7 @@ void SEARCH_PANE_LISTVIEW::OnItemSelected( wxListEvent& aEvent )
void SEARCH_PANE_LISTVIEW::OnItemDeselected( wxListEvent& aEvent ) void SEARCH_PANE_LISTVIEW::OnItemDeselected( wxListEvent& aEvent )
{ {
CallAfter( CallAfter(
[&]() [=]()
{ {
std::vector<long> list; std::vector<long> list;
GetSelectRowsList( list ); GetSelectRowsList( list );