Be careful of infobar outliving symbol.
Fixes https://gitlab.com/kicad/code/kicad/issues/14680
This commit is contained in:
parent
8a52941624
commit
384f65c45e
|
@ -782,7 +782,7 @@ void SYMBOL_EDIT_FRAME::SetCurSymbol( LIB_SYMBOL* aSymbol, bool aUpdateZoom )
|
||||||
wxEmptyString );
|
wxEmptyString );
|
||||||
|
|
||||||
button->Bind( wxEVT_COMMAND_HYPERLINK, std::function<void( wxHyperlinkEvent& aEvent )>(
|
button->Bind( wxEVT_COMMAND_HYPERLINK, std::function<void( wxHyperlinkEvent& aEvent )>(
|
||||||
[&]( wxHyperlinkEvent& aEvent )
|
[=]( wxHyperlinkEvent& aEvent )
|
||||||
{
|
{
|
||||||
InvokeSchEditSymbolLibTable( &Kiway(), this );
|
InvokeSchEditSymbolLibTable( &Kiway(), this );
|
||||||
} ) );
|
} ) );
|
||||||
|
@ -796,6 +796,8 @@ void SYMBOL_EDIT_FRAME::SetCurSymbol( LIB_SYMBOL* aSymbol, bool aUpdateZoom )
|
||||||
else if( IsSymbolAlias() )
|
else if( IsSymbolAlias() )
|
||||||
{
|
{
|
||||||
wxString parentSymbolName = m_symbol->GetParent().lock()->GetName();
|
wxString parentSymbolName = m_symbol->GetParent().lock()->GetName();
|
||||||
|
int unit = GetUnit();
|
||||||
|
int convert = GetConvert();
|
||||||
wxString msg;
|
wxString msg;
|
||||||
wxString link;
|
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 );
|
wxHyperlinkCtrl* button = new wxHyperlinkCtrl( infobar, wxID_ANY, link, wxEmptyString );
|
||||||
button->Bind( wxEVT_COMMAND_HYPERLINK, std::function<void( wxHyperlinkEvent& aEvent )>(
|
button->Bind( wxEVT_COMMAND_HYPERLINK, std::function<void( wxHyperlinkEvent& aEvent )>(
|
||||||
[&]( wxHyperlinkEvent& aEvent )
|
[=]( wxHyperlinkEvent& aEvent )
|
||||||
{
|
{
|
||||||
LoadSymbolFromCurrentLib( m_symbol->GetParent().lock()->GetName(),
|
LoadSymbolFromCurrentLib( parentSymbolName, unit, convert );
|
||||||
GetUnit(), GetConvert() );
|
|
||||||
} ) );
|
} ) );
|
||||||
|
|
||||||
infobar->RemoveAllButtons();
|
infobar->RemoveAllButtons();
|
||||||
|
|
Loading…
Reference in New Issue