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

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



The branch, master has been updated
       via  750f05c6fe9a9ce7e40f254923ab61a10c5ffa2b (commit)
      from  a82b657073aff33708a2814ae9063134f6051bc1 (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/common/draw_helpers.c |    3 +++
 src/polygon.c                 |    1 +
 2 files changed, 4 insertions(+), 0 deletions(-)


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

commit 750f05c6fe9a9ce7e40f254923ab61a10c5ffa2b
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>

    Give callback from NoHolesPolygonDicer ownership of the returned contour
    
    This means callers of NoHolesPolygonDicer() should call poly_FreeContours
    on the contour they are passed (if they do not wish to retain it).

:100644 100644 1b7c6b7... a7c4620... M	src/hid/common/draw_helpers.c
:100644 100644 d5df073... 46cba47... M	src/polygon.c

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

commit 750f05c6fe9a9ce7e40f254923ab61a10c5ffa2b
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>

    Give callback from NoHolesPolygonDicer ownership of the returned contour
    
    This means callers of NoHolesPolygonDicer() should call poly_FreeContours
    on the contour they are passed (if they do not wish to retain it).

diff --git a/src/hid/common/draw_helpers.c b/src/hid/common/draw_helpers.c
index 1b7c6b7..a7c4620 100644
--- a/src/hid/common/draw_helpers.c
+++ b/src/hid/common/draw_helpers.c
@@ -57,7 +57,10 @@ static void thindraw_contour (hidGC gc, PLINE *pl)
 static void fill_contour_cb (PLINE *pl, void *user_data)
 {
   hidGC gc = user_data;
+  PLINE *local_pl = pl;
+
   fill_contour (gc, pl);
+  poly_FreeContours (&local_pl);
 }
 
 void common_fill_pcb_polygon (hidGC gc, PolygonType *poly,
diff --git a/src/polygon.c b/src/polygon.c
index d5df073..46cba47 100644
--- a/src/polygon.c
+++ b/src/polygon.c
@@ -1517,6 +1517,7 @@ r_NoHolesPolygonDicer (PLINE * p,
   pa->contours = p;
   if (!p->next)                 /* no holes */
     {
+      pa->contours = NULL; /* The callback now owns the contour */
       emit (p, user_data);
       poly_Free (&pa);
       return;




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