Removed a bug (function Delete_Zone() ) which crashes pcbnew

This commit is contained in:
CHARRAS 2007-11-15 10:09:12 +00:00
parent 0605d07263
commit 37d19fb2d6
5 changed files with 20 additions and 11 deletions

View File

@ -4,6 +4,12 @@ Started 2007-June-11
Please add newer entries at the top, list the date and your name with
email address.
2007-Nov-15 UPDATE Jean-Pierre Charras <jean-pierre.charras@inpg.fr>
================================================================================
+pcbnew:
Removed a bug (function Delete_Zone() ) which crashes pcbnew when erasing a zone by popup menu
2007-Nov-13 UPDATE Geoff Harland <gharlandau@yahoo.com.au>
================================================================================
+ eeschema & pcbnew

View File

@ -340,7 +340,7 @@ void SEGVIA::ReturnLayerPair( int* top_layer, int* bottom_layer ) const
}
/* Remove this from the track linked list
/* Remove this from the track or zone linked list
*/
void TRACK::UnLink()
{

View File

@ -1020,7 +1020,7 @@ int WinEDA_PcbFrame::ReadPcbFile( wxDC* DC, FILE* File, bool Append )
if( Append )
{
for( ; StartTrack != NULL; StartTrack = (TRACK*) StartTrack->Pnext )
for( ; StartTrack != NULL; StartTrack = StartTrack->Next() )
{
if( StartTrack->Pnext == NULL )
break;
@ -1037,11 +1037,11 @@ int WinEDA_PcbFrame::ReadPcbFile( wxDC* DC, FILE* File, bool Append )
if( strnicmp( Line, "$ZONE", 5 ) == 0 )
{
TRACK* StartZone = m_Pcb->m_Zone;
SEGZONE* StartZone = m_Pcb->m_Zone;
if( Append )
{
for( ; StartZone != NULL; StartZone = (TRACK*) StartZone->Pnext )
for( ; StartZone != NULL; StartZone = StartZone->Next() )
{
if( StartZone->Pnext == NULL )
break;

View File

@ -437,24 +437,27 @@ void WinEDA_PcbFrame::Edit_Zone_Width( wxDC* DC, SEGZONE* aZone )
void WinEDA_PcbFrame::Delete_Zone( wxDC* DC, SEGZONE* aZone )
/**********************************************************/
/* Efface la zone Zone.
* La zone est constituee des segments zones de meme TimeStamp
/* Remove the zone which include the segment aZone.
* A zone is a group of segments which have the same TimeStamp
*/
{
if ( aZone == NULL ) return;
int nb_segm = 0;
bool modify = FALSE;
unsigned long TimeStamp = aZone->m_TimeStamp; // Save reference time stamp (aZone will be deleted)
SEGZONE* next;
for( SEGZONE* zone = m_Pcb->m_Zone; zone; zone = next )
for( SEGZONE* zone = m_Pcb->m_Zone; zone != NULL; zone = next )
{
next = zone->Next();
if( zone->m_TimeStamp == aZone->m_TimeStamp )
if( zone->m_TimeStamp == TimeStamp )
{
modify = TRUE;
/* effacement des segments a l'ecran */
/* Erase segment from screen */
Trace_Une_Piste( DrawPanel, DC, zone, nb_segm, GR_XOR );
/* remove item from linked list and free memory */
zone->DeleteStructure();
}
}

View File

@ -1,4 +1,4 @@
release version:
09 nov 2007
files (.zip,.tgz):
kicad-2007-11-09
kicad-2007-11-14