Commit 37d19fb2 authored by CHARRAS's avatar CHARRAS

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

parent 0605d072
...@@ -4,6 +4,12 @@ Started 2007-June-11 ...@@ -4,6 +4,12 @@ Started 2007-June-11
Please add newer entries at the top, list the date and your name with Please add newer entries at the top, list the date and your name with
email address. 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> 2007-Nov-13 UPDATE Geoff Harland <gharlandau@yahoo.com.au>
================================================================================ ================================================================================
+ eeschema & pcbnew + eeschema & pcbnew
......
...@@ -340,7 +340,7 @@ void SEGVIA::ReturnLayerPair( int* top_layer, int* bottom_layer ) const ...@@ -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() void TRACK::UnLink()
{ {
......
...@@ -1020,7 +1020,7 @@ int WinEDA_PcbFrame::ReadPcbFile( wxDC* DC, FILE* File, bool Append ) ...@@ -1020,7 +1020,7 @@ int WinEDA_PcbFrame::ReadPcbFile( wxDC* DC, FILE* File, bool Append )
if( Append ) if( Append )
{ {
for( ; StartTrack != NULL; StartTrack = (TRACK*) StartTrack->Pnext ) for( ; StartTrack != NULL; StartTrack = StartTrack->Next() )
{ {
if( StartTrack->Pnext == NULL ) if( StartTrack->Pnext == NULL )
break; break;
...@@ -1037,11 +1037,11 @@ int WinEDA_PcbFrame::ReadPcbFile( wxDC* DC, FILE* File, bool Append ) ...@@ -1037,11 +1037,11 @@ int WinEDA_PcbFrame::ReadPcbFile( wxDC* DC, FILE* File, bool Append )
if( strnicmp( Line, "$ZONE", 5 ) == 0 ) if( strnicmp( Line, "$ZONE", 5 ) == 0 )
{ {
TRACK* StartZone = m_Pcb->m_Zone; SEGZONE* StartZone = m_Pcb->m_Zone;
if( Append ) if( Append )
{ {
for( ; StartZone != NULL; StartZone = (TRACK*) StartZone->Pnext ) for( ; StartZone != NULL; StartZone = StartZone->Next() )
{ {
if( StartZone->Pnext == NULL ) if( StartZone->Pnext == NULL )
break; break;
......
...@@ -437,24 +437,27 @@ void WinEDA_PcbFrame::Edit_Zone_Width( wxDC* DC, SEGZONE* aZone ) ...@@ -437,24 +437,27 @@ void WinEDA_PcbFrame::Edit_Zone_Width( wxDC* DC, SEGZONE* aZone )
void WinEDA_PcbFrame::Delete_Zone( wxDC* DC, SEGZONE* aZone ) void WinEDA_PcbFrame::Delete_Zone( wxDC* DC, SEGZONE* aZone )
/**********************************************************/ /**********************************************************/
/* Efface la zone Zone. /* Remove the zone which include the segment aZone.
* La zone est constituee des segments zones de meme TimeStamp * A zone is a group of segments which have the same TimeStamp
*/ */
{ {
if ( aZone == NULL ) return;
int nb_segm = 0; int nb_segm = 0;
bool modify = FALSE; bool modify = FALSE;
unsigned long TimeStamp = aZone->m_TimeStamp; // Save reference time stamp (aZone will be deleted)
SEGZONE* next; 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(); next = zone->Next();
if( zone->m_TimeStamp == TimeStamp )
if( zone->m_TimeStamp == aZone->m_TimeStamp )
{ {
modify = TRUE; modify = TRUE;
/* effacement des segments a l'ecran */ /* Erase segment from screen */
Trace_Une_Piste( DrawPanel, DC, zone, nb_segm, GR_XOR ); Trace_Une_Piste( DrawPanel, DC, zone, nb_segm, GR_XOR );
/* remove item from linked list and free memory */
zone->DeleteStructure(); zone->DeleteStructure();
} }
} }
......
release version: release version:
09 nov 2007 09 nov 2007
files (.zip,.tgz): files (.zip,.tgz):
kicad-2007-11-09 kicad-2007-11-14
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment