From ff8fae377c35944e2ecd1230c70490aeff1b6072 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Wed, 3 May 2023 12:27:32 +0100 Subject: [PATCH] Pass aEvent by value. It will have changed by the time CallAfter() is executed. Fixes https://gitlab.com/kicad/code/kicad/issues/12475 --- common/widgets/search_pane_tab.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/common/widgets/search_pane_tab.cpp b/common/widgets/search_pane_tab.cpp index 2fb5aee674..dd6dffeb88 100644 --- a/common/widgets/search_pane_tab.cpp +++ b/common/widgets/search_pane_tab.cpp @@ -70,7 +70,7 @@ void SEARCH_PANE_LISTVIEW::GetSelectRowsList( std::vector& 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 list; GetSelectRowsList( list ); @@ -101,7 +101,7 @@ void SEARCH_PANE_LISTVIEW::OnItemSelected( wxListEvent& aEvent ) void SEARCH_PANE_LISTVIEW::OnItemDeselected( wxListEvent& aEvent ) { CallAfter( - [&]() + [=]() { std::vector list; GetSelectRowsList( list );