Make sure to set the lib table for a plugin before it gets used

Fixes https://gitlab.com/kicad/code/kicad/-/issues/12847
This commit is contained in:
Jon Evans 2022-12-10 16:04:27 -05:00
parent 966dee6730
commit 39a8ab8738
2 changed files with 4 additions and 1 deletions

View File

@ -355,9 +355,10 @@ void SYMBOL_LIB_TABLE::LoadSymbolLib( std::vector<LIB_SYMBOL*>& aSymbolList,
wxString options = row->GetOptions();
if( aPowerSymbolsOnly )
row->SetOptions( row->GetOptions() + " " + PropPowerSymsOnly );
row->SetOptions( row->GetOptions() + " " + PropPowerSymsOnly );
row->SetLoaded( false );
row->plugin->SetLibTable( this );
row->plugin->EnumerateSymbolLib( aSymbolList, row->GetFullURI( true ), row->GetProperties() );
row->SetLoaded( true );

View File

@ -133,6 +133,8 @@ bool SYMBOL_TREE_MODEL_ADAPTER::AddLibraries( const std::vector<wxString>& aNick
{
SYMBOL_LIB_TABLE_ROW* row = m_libs->FindRow( pair.first );
wxCHECK2( row, continue );
if( !row->GetIsVisible() )
continue;