Do not invalidate board caches during DRC

Footprints now modify their parent container when destroyed due to
26542796, and a temporary footprint is created during DRC
in some situations.  This can lead to board caches being messed
with during DRC which can cause unpredictable bad effects due to
multithreading.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/13844


(cherry picked from commit 8440d7258b)
This commit is contained in:
Jon Evans 2023-02-24 22:55:32 -05:00
parent 981bf328ae
commit 39df5f3b15
1 changed files with 7 additions and 1 deletions

View File

@ -355,7 +355,13 @@ bool FOOTPRINT::FootprintNeedsUpdate( const FOOTPRINT* aLibFootprint )
std::unique_ptr<FOOTPRINT> temp( static_cast<FOOTPRINT*>( Clone() ) );
temp->Flip( {0,0}, false );
temp->SetParentGroup( nullptr );
return temp->FootprintNeedsUpdate( aLibFootprint );
bool needsUpdate = temp->FootprintNeedsUpdate( aLibFootprint );
// This temporary footprint must not have a parent when it goes out of scope because it must
// not trigger then IncrementTimestamp call in ~FOOTPRINT.
temp->SetParent( nullptr );
return needsUpdate;
}
TEST( GetDescription(), aLibFootprint->GetDescription() );