PCBNew: Fix crash while routing in Legacy canvas
it was due to a incorrect behavior of TRACK::GetBestInsertPoint( BOARD* aPcb ) Also: update comment for this method. Fixes: lp:1767061 https://bugs.launchpad.net/kicad/+bug/1767061
This commit is contained in:
parent
7a923ab969
commit
641c8bb548
|
@ -512,7 +512,10 @@ TRACK* TRACK::GetBestInsertPoint( BOARD* aPcb )
|
|||
return track->Next();
|
||||
}
|
||||
|
||||
return NULL;
|
||||
if( Type() == PCB_ZONE_T )
|
||||
return aPcb->m_Zone.GetFirst();
|
||||
else
|
||||
return aPcb->m_Track.GetFirst();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -147,10 +147,13 @@ public:
|
|||
/**
|
||||
* Function GetBestInsertPoint
|
||||
* searches the "best" insertion point within the track linked list.
|
||||
* The best point is the begging of the corresponding net code section.
|
||||
* The best point is currently the end of the corresponding net code section.
|
||||
* (The BOARD::m_Track and BOARD::m_Zone lists are sorted by netcode.)
|
||||
* @param aPcb The BOARD to search for the insertion point.
|
||||
* @return TRACK* - the item found in the linked list (or NULL if no track)
|
||||
* @return TRACK* - the insertion point in the linked list.
|
||||
* this is the next item after the last item having my net code.
|
||||
* therefore the track to insert must be inserted before the insertion point.
|
||||
* if the best insertion point is the end of list, the returned value is NULL
|
||||
*/
|
||||
TRACK* GetBestInsertPoint( BOARD* aPcb );
|
||||
|
||||
|
|
Loading…
Reference in New Issue