Be careful of infobar outliving symbol.
Fixes https://gitlab.com/kicad/code/kicad/issues/14680
This commit is contained in:
parent
9e735fc940
commit
7cc014cf9e
|
@ -781,7 +781,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 );
|
||||||
} ) );
|
} ) );
|
||||||
|
@ -795,6 +795,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;
|
||||||
|
|
||||||
|
@ -806,10 +808,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