A bit of defensive code for an unreproducible bug.
Fixes https://gitlab.com/kicad/code/kicad/issues/4376
This commit is contained in:
parent
19dc1f8b69
commit
935cab160b
|
@ -836,11 +836,14 @@ template<typename T>
|
||||||
static void moveNoFlagToVector( std::deque<T>& aList, std::vector<BOARD_ITEM*>& aTarget, bool aIsNew )
|
static void moveNoFlagToVector( std::deque<T>& aList, std::vector<BOARD_ITEM*>& aTarget, bool aIsNew )
|
||||||
{
|
{
|
||||||
std::copy_if( aList.begin(), aList.end(), std::back_inserter( aTarget ),
|
std::copy_if( aList.begin(), aList.end(), std::back_inserter( aTarget ),
|
||||||
[](T aItem)
|
[aIsNew]( T aItem )
|
||||||
{
|
{
|
||||||
bool retval = ( aItem->GetFlags() & FLAG0 ) == 0;
|
bool doCopy = ( aItem->GetFlags() & FLAG0 ) == 0;
|
||||||
|
|
||||||
aItem->ClearFlags( FLAG0 );
|
aItem->ClearFlags( FLAG0 );
|
||||||
return retval;
|
aItem->SetFlags( aIsNew ? IS_NEW : 0 );
|
||||||
|
|
||||||
|
return doCopy;
|
||||||
} );
|
} );
|
||||||
|
|
||||||
if( aIsNew )
|
if( aIsNew )
|
||||||
|
|
Loading…
Reference in New Issue