[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

gEDA-cvs: pcb.git: branch: master updated (ff24fd3c66a2da86b55b2d2c0e2af56cec0d5bde)



The branch, master has been updated
       via  ff24fd3c66a2da86b55b2d2c0e2af56cec0d5bde (commit)
       via  7308f512307158944482227d58e66373fd023d62 (commit)
      from  f7ecf831467068f0ba288a0c136f05768893a826 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


=========
 Summary
=========

 src/action.c |    4 ++--
 src/mymem.c  |    1 +
 2 files changed, 3 insertions(+), 2 deletions(-)


=================
 Commit Messages
=================

commit ff24fd3c66a2da86b55b2d2c0e2af56cec0d5bde
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>

    action.c: Unconditionally notify NetlistChanged() when loading new netlist
    
    We need to call NetlistChanged() even if the loading failed, otherwise
    the GUI is not informed that we free'd the old netlist.

:100644 100644 665ae91... b1c33ab... M	src/action.c

commit 7308f512307158944482227d58e66373fd023d62
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>

    Fix crash upon pressing "f" hotkey (find connected) after a board revert.
    
    Reproduction of this crash (before fix!):
    
    1. Load a PCB with a netlist.
    2. Open the netlist window to initialise the netlist.
    3. File->Revert the PCB
    4. Hit "f" key whilst the croshair is over any pad
    
    Analysis:
    
    When you File->Revert the layout, the GTK GUI's netlist window is not
    cleared as the old layout is free'd (or as an equivalent cause..
    "NetlistChanged(0)" is not called the reverted layout is loaded).
    
    Having had the netlist window open before the revert, the
    data-structures in the GUI are initialised, but point to the pre-revert
    layout. They are not explicitly updated with a "NetlistChanged"
    notification, so when the user next hits "f" for find, it will try to
    use the stale pointers it already had.
    
    Fix:
    
    Call "NetlistChanged (0);" after free'ing the netlist memory. The
    "FreeNetlistMemory()" call only free's the individual nets, the parent
    netlist structure which points to that memory and identifies how many
    nets are present is zeroed by the FreeNetlistMemory() call, so we can
    safely call NetlistChanged() at this point, before we have reloaded a
    new netlist.

:100644 100644 2dd10a1... f7939e7... M	src/mymem.c

=========
 Changes
=========

commit ff24fd3c66a2da86b55b2d2c0e2af56cec0d5bde
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>

    action.c: Unconditionally notify NetlistChanged() when loading new netlist
    
    We need to call NetlistChanged() even if the loading failed, otherwise
    the GUI is not informed that we free'd the old netlist.

diff --git a/src/action.c b/src/action.c
index 665ae91..b1c33ab 100644
--- a/src/action.c
+++ b/src/action.c
@@ -5852,8 +5852,8 @@ ActionLoadFrom (int argc, char **argv, Coord x, Coord y)
 	free (PCB->Netlistname);
       PCB->Netlistname = StripWhiteSpaceAndDup (name);
       FreeLibraryMemory (&PCB->NetlistLib);
-      if (!ImportNetlist (PCB->Netlistname))
-	NetlistChanged (1);
+      ImportNetlist (PCB->Netlistname);
+      NetlistChanged (1);
     }
   else if (strcasecmp (function, "Revert") == 0 && PCB->Filename
 	   && (!PCB->Changed

commit 7308f512307158944482227d58e66373fd023d62
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>

    Fix crash upon pressing "f" hotkey (find connected) after a board revert.
    
    Reproduction of this crash (before fix!):
    
    1. Load a PCB with a netlist.
    2. Open the netlist window to initialise the netlist.
    3. File->Revert the PCB
    4. Hit "f" key whilst the croshair is over any pad
    
    Analysis:
    
    When you File->Revert the layout, the GTK GUI's netlist window is not
    cleared as the old layout is free'd (or as an equivalent cause..
    "NetlistChanged(0)" is not called the reverted layout is loaded).
    
    Having had the netlist window open before the revert, the
    data-structures in the GUI are initialised, but point to the pre-revert
    layout. They are not explicitly updated with a "NetlistChanged"
    notification, so when the user next hits "f" for find, it will try to
    use the stale pointers it already had.
    
    Fix:
    
    Call "NetlistChanged (0);" after free'ing the netlist memory. The
    "FreeNetlistMemory()" call only free's the individual nets, the parent
    netlist structure which points to that memory and identifies how many
    nets are present is zeroed by the FreeNetlistMemory() call, so we can
    safely call NetlistChanged() at this point, before we have reloaded a
    new netlist.

diff --git a/src/mymem.c b/src/mymem.c
index 2dd10a1..f7939e7 100644
--- a/src/mymem.c
+++ b/src/mymem.c
@@ -677,6 +677,7 @@ FreePCBMemory (PCBType *pcb)
   for (i = 0; i <= MAX_FONTPOSITION; i++)
     free (pcb->Font.Symbol[i].Line);
   FreeLibraryMemory (&pcb->NetlistLib);
+  NetlistChanged (0);
   FreeAttributeListMemory (&pcb->Attributes);
   /* clear struct */
   memset (pcb, 0, sizeof (PCBType));




_______________________________________________
geda-cvs mailing list
geda-cvs@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-cvs