Unselected tree before syncing

On GTK, the selected item is checked for its parent when being
unselected.  This breaks if the parent has been removed by the Sync()
call, so we need to ensure that the unselect all call happens prior
This commit is contained in:
Seth Hillbrand 2024-06-14 15:01:25 -07:00
parent 9f4dfe77cb
commit d21eba4021
1 changed files with 4 additions and 1 deletions

View File

@ -1040,10 +1040,13 @@ void FOOTPRINT_EDIT_FRAME::SyncLibraryTree( bool aProgress )
GFootprintList.ReadFootprintFiles( fpTable, nullptr, nullptr );
}
// Unselect before syncing to avoid null reference in the adapter
// if a selected item is removed during the sync
GetLibTree()->Unselect();
// Sync the LIB_TREE to the FOOTPRINT_INFO list
adapter->Sync( fpTable );
GetLibTree()->Unselect();
GetLibTree()->Regenerate( true );
if( target.IsValid() )