Revision: 55518
          http://sourceforge.net/p/brlcad/code/55518
Author:   bob1961
Date:     2013-05-21 13:02:03 +0000 (Tue, 21 May 2013)
Log Message:
-----------
Can't assume that display lists are contiguous in gdl_headSolid. This was the 
culprit/bug that was causing geometry to mysteriously disappear from the 
display in MGED and Archer.

Modified Paths:
--------------
    brlcad/trunk/src/libged/erase.c

Modified: brlcad/trunk/src/libged/erase.c
===================================================================
--- brlcad/trunk/src/libged/erase.c     2013-05-21 12:57:16 UTC (rev 55517)
+++ brlcad/trunk/src/libged/erase.c     2013-05-21 13:02:03 UTC (rev 55518)
@@ -263,11 +263,13 @@
        next_gdlp = BU_LIST_PNEXT(ged_display_list, gdlp);
 
        if (BU_STR_EQUAL(path, bu_vls_addr(&gdlp->gdl_path))) {
+           if (gedp->ged_free_vlist_callback != 
GED_FREE_VLIST_CALLBACK_PTR_NULL) {
 
-           if (gedp->ged_free_vlist_callback != 
GED_FREE_VLIST_CALLBACK_PTR_NULL)
-               (*gedp->ged_free_vlist_callback)(BU_LIST_FIRST(solid, 
&gdlp->gdl_headSolid)->s_dlist,
-                                                BU_LIST_LAST(solid, 
&gdlp->gdl_headSolid)->s_dlist -
-                                                BU_LIST_FIRST(solid, 
&gdlp->gdl_headSolid)->s_dlist + 1);
+               /* We can't assume the display lists are contiguous */
+               FOR_ALL_SOLIDS(sp, &gdlp->gdl_headSolid) {
+                   (*gedp->ged_free_vlist_callback)(BU_LIST_FIRST(solid, 
&gdlp->gdl_headSolid)->s_dlist, 1);
+               }
+           }
 
            /* Free up the solids list associated with this display list */
            while (BU_LIST_WHILE(sp, solid, &gdlp->gdl_headSolid)) {
@@ -533,11 +535,14 @@
     struct solid *sp;
     struct directory *dp;
 
-    if (gedp->ged_free_vlist_callback != GED_FREE_VLIST_CALLBACK_PTR_NULL)
-       (*gedp->ged_free_vlist_callback)(BU_LIST_FIRST(solid, 
&gdlp->gdl_headSolid)->s_dlist,
-                                        BU_LIST_LAST(solid, 
&gdlp->gdl_headSolid)->s_dlist -
-                                        BU_LIST_FIRST(solid, 
&gdlp->gdl_headSolid)->s_dlist + 1);
+    if (gedp->ged_free_vlist_callback != GED_FREE_VLIST_CALLBACK_PTR_NULL) {
 
+       /* We can't assume the display lists are contiguous */
+       FOR_ALL_SOLIDS(sp, &gdlp->gdl_headSolid) {
+           (*gedp->ged_free_vlist_callback)(BU_LIST_FIRST(solid, 
&gdlp->gdl_headSolid)->s_dlist, 1);
+       }
+    }
+
     /* Free up the solids list associated with this display list */
     while (BU_LIST_WHILE(sp, solid, &gdlp->gdl_headSolid)) {
        dp = FIRST_SOLID(sp);

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service 
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_may
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to