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

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



The branch, master has been updated
       via  72c69958ada7b07057bf210e0ee6f2d1b2d648f1 (commit)
       via  cdc4b1830fd567efc51322a3ee9587e910f92283 (commit)
       via  88bcf416c7c3f26292b604197bfcacdc7d16f9d7 (commit)
      from  2407ce806639116f3f7dc1e85c45bef6a73e7758 (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/hid/gtk/gui-netlist-window.c |   21 ++-------------------
 src/hid/gtk/gui.h                |    1 -
 2 files changed, 2 insertions(+), 20 deletions(-)


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

commit 72c69958ada7b07057bf210e0ee6f2d1b2d648f1
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>

    hid/gtk: Do not run a main loop from within the netlist window code.
    
    It turns out that this is a really bad idea.. if the main loop is kept
    busy, the new main-loop never exits and the events can become reentrant.
    
    I discovered this when testing code for an animation which used the main
    event loop for its timing. Each time a node was selected in the netlist
    window, stack-frame would grow - as the new nested main loops never
    became idle. Segfaults ensued quite readily, presumably due to the code
    not being designed to be reentrant.
    
    It appears from reading the code, that these:
    
      while (gtk_events_pending ())        /* Make sure everything gets built */
        gtk_main_iteration ();
    
    Are not actually necessary.

:100644 100644 0f65d8b... 31caa2e... M	src/hid/gtk/gui-netlist-window.c

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

    hid/gtk: Skip check before calling ghid_netlist_window_create
    
    If the window already exists, ghid_netlist_window_create()
    is a NOOP, so there is no point in checking twice.

:100644 100644 7ec5b95... 0f65d8b... M	src/hid/gtk/gui-netlist-window.c

commit 88bcf416c7c3f26292b604197bfcacdc7d16f9d7
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>

    hid/gtk: Remove unused function ghid_netlist_nodes_update ()

:100644 100644 26b97bb... 7ec5b95... M	src/hid/gtk/gui-netlist-window.c
:100644 100644 930df19... 114574f... M	src/hid/gtk/gui.h

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

commit 72c69958ada7b07057bf210e0ee6f2d1b2d648f1
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>

    hid/gtk: Do not run a main loop from within the netlist window code.
    
    It turns out that this is a really bad idea.. if the main loop is kept
    busy, the new main-loop never exits and the events can become reentrant.
    
    I discovered this when testing code for an animation which used the main
    event loop for its timing. Each time a node was selected in the netlist
    window, stack-frame would grow - as the new nested main loops never
    became idle. Segfaults ensued quite readily, presumably due to the code
    not being designed to be reentrant.
    
    It appears from reading the code, that these:
    
      while (gtk_events_pending ())        /* Make sure everything gets built */
        gtk_main_iteration ();
    
    Are not actually necessary.

diff --git a/src/hid/gtk/gui-netlist-window.c b/src/hid/gtk/gui-netlist-window.c
index 0f65d8b..31caa2e 100644
--- a/src/hid/gtk/gui-netlist-window.c
+++ b/src/hid/gtk/gui-netlist-window.c
@@ -622,9 +622,6 @@ node_get_node_from_name (gchar * node_name, LibraryMenuType ** node_net)
    */
   ghid_netlist_window_create (gport);
 
-  while (gtk_events_pending ())	/* Make sure everything gets built */
-    gtk_main_iteration ();
-
   /* Now walk through node entries of each net in the net model looking for
      |  the node_name.
    */
@@ -883,9 +880,6 @@ ghid_get_net_from_node_name (gchar * node_name, gboolean enabled_only)
    */
   ghid_netlist_window_create (gport);
 
-  while (gtk_events_pending ())	/* Make sure everything gets built */
-    gtk_main_iteration ();
-
   /* If no netlist is loaded the window doesn't appear. */
   if (netlist_window == NULL)
     return NULL;

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

    hid/gtk: Skip check before calling ghid_netlist_window_create
    
    If the window already exists, ghid_netlist_window_create()
    is a NOOP, so there is no point in checking twice.

diff --git a/src/hid/gtk/gui-netlist-window.c b/src/hid/gtk/gui-netlist-window.c
index 7ec5b95..0f65d8b 100644
--- a/src/hid/gtk/gui-netlist-window.c
+++ b/src/hid/gtk/gui-netlist-window.c
@@ -620,8 +620,7 @@ node_get_node_from_name (gchar * node_name, LibraryMenuType ** node_net)
   /* Have to force the netlist window created because we need the treeview
      |  models constructed to do the search.
    */
-  if (!netlist_window)
-    ghid_netlist_window_create (gport);
+  ghid_netlist_window_create (gport);
 
   while (gtk_events_pending ())	/* Make sure everything gets built */
     gtk_main_iteration ();
@@ -882,8 +881,7 @@ ghid_get_net_from_node_name (gchar * node_name, gboolean enabled_only)
      |  models constructed so we can find the LibraryMenuType pointer the
      |  caller wants.
    */
-  if (!netlist_window)
-    ghid_netlist_window_create (gport);
+  ghid_netlist_window_create (gport);
 
   while (gtk_events_pending ())	/* Make sure everything gets built */
     gtk_main_iteration ();

commit 88bcf416c7c3f26292b604197bfcacdc7d16f9d7
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>

    hid/gtk: Remove unused function ghid_netlist_nodes_update ()

diff --git a/src/hid/gtk/gui-netlist-window.c b/src/hid/gtk/gui-netlist-window.c
index 26b97bb..7ec5b95 100644
--- a/src/hid/gtk/gui-netlist-window.c
+++ b/src/hid/gtk/gui-netlist-window.c
@@ -111,9 +111,6 @@ static LibraryMenuType *node_selected_net;
    |		PCB calls this to tell the gui netlist code the layout net has
    |		changed and the gui data structures (net and optionally node data
    |		models) should be rebuilt.
-   |
-   |   ghid_netlist_nodes_update(LibraryMenuType *net)
-   |		Called when the node model should be updated to a netlist.
 */
 
 
@@ -965,12 +962,6 @@ ghid_netlist_highlight_node (gchar * node_name)
     while (gtk_tree_model_iter_next (node_model, &iter));
 }
 
-void
-ghid_netlist_nodes_update (LibraryMenuType * net)
-{
-  node_model_update (net);
-}
-
 /* If code in PCB should change the netlist, call this to update
    |  what's in the netlist window.
 */
diff --git a/src/hid/gtk/gui.h b/src/hid/gtk/gui.h
index 930df19..114574f 100644
--- a/src/hid/gtk/gui.h
+++ b/src/hid/gtk/gui.h
@@ -441,7 +441,6 @@ void ghid_set_status_line_label (void);
 void ghid_netlist_window_create (GHidPort * out);
 void ghid_netlist_window_show (GHidPort * out, gboolean raise);
 void ghid_netlist_window_update (gboolean init_nodes);
-void ghid_netlist_nodes_update (LibraryMenuType * net);
 
 LibraryMenuType *ghid_get_net_from_node_name (gchar * name, gboolean);
 void ghid_netlist_highlight_node (gchar * name);




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