diff --git a/eeschema/symbol_editor/symbol_edit_frame.cpp b/eeschema/symbol_editor/symbol_edit_frame.cpp index 0d59e4a9fa..a6c054b7ce 100644 --- a/eeschema/symbol_editor/symbol_edit_frame.cpp +++ b/eeschema/symbol_editor/symbol_edit_frame.cpp @@ -782,7 +782,7 @@ void SYMBOL_EDIT_FRAME::SetCurSymbol( LIB_SYMBOL* aSymbol, bool aUpdateZoom ) wxEmptyString ); button->Bind( wxEVT_COMMAND_HYPERLINK, std::function( - [&]( wxHyperlinkEvent& aEvent ) + [=]( wxHyperlinkEvent& aEvent ) { InvokeSchEditSymbolLibTable( &Kiway(), this ); } ) ); @@ -796,6 +796,8 @@ void SYMBOL_EDIT_FRAME::SetCurSymbol( LIB_SYMBOL* aSymbol, bool aUpdateZoom ) else if( IsSymbolAlias() ) { wxString parentSymbolName = m_symbol->GetParent().lock()->GetName(); + int unit = GetUnit(); + int convert = GetConvert(); wxString msg; wxString link; @@ -807,10 +809,9 @@ void SYMBOL_EDIT_FRAME::SetCurSymbol( LIB_SYMBOL* aSymbol, bool aUpdateZoom ) wxHyperlinkCtrl* button = new wxHyperlinkCtrl( infobar, wxID_ANY, link, wxEmptyString ); button->Bind( wxEVT_COMMAND_HYPERLINK, std::function( - [&]( wxHyperlinkEvent& aEvent ) + [=]( wxHyperlinkEvent& aEvent ) { - LoadSymbolFromCurrentLib( m_symbol->GetParent().lock()->GetName(), - GetUnit(), GetConvert() ); + LoadSymbolFromCurrentLib( parentSymbolName, unit, convert ); } ) ); infobar->RemoveAllButtons();