Revision: 56395
          http://sourceforge.net/p/brlcad/code/56395
Author:   starseeker
Date:     2013-07-31 20:46:39 +0000 (Wed, 31 Jul 2013)
Log Message:
-----------
Re-arrange some of the memory freeing.

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

Modified: brlcad/trunk/src/libged/comb.c
===================================================================
--- brlcad/trunk/src/libged/comb.c      2013-07-31 20:45:49 UTC (rev 56394)
+++ brlcad/trunk/src/libged/comb.c      2013-07-31 20:46:39 UTC (rev 56395)
@@ -334,15 +334,14 @@
     db_search_freeplan(&dbplan);
     db_free_full_path_list(toplevel_list);
 
-    /* Done searching - now we can clear the original tree */
+    /* Done searching - now we can free search structures and clear the 
original tree */
+    bu_vls_free(&plan_string);
+    db_free_full_path_list(path_list);
     if (_ged_clear_comb_tree(gedp, dp) == GED_ERROR) {
        bu_vls_printf(gedp->ged_result_str, "ERROR: %s tree clearing failed", 
dp->d_namep);
-       db_free_full_path_list(path_list);
-       bu_ptbl_free(non_union_objects);
        bu_ptbl_free(solids);
        bu_ptbl_free(combs);
        bu_ptbl_free(combs_outside_of_tree);
-       bu_vls_free(&plan_string);
        return GED_ERROR;
     }
 
@@ -353,11 +352,9 @@
            /* add "child" comb to the newly cleared parent */
            if (_ged_combadd(gedp, (*dp_curr), dp->d_namep, 0, WMOP_UNION, 0, 
0) == RT_DIR_NULL) {
                bu_vls_printf(gedp->ged_result_str, "Error adding '%s' to 
'%s'\n", (*dp_curr)->d_namep, dp->d_namep);
-               db_free_full_path_list(path_list);
                bu_ptbl_free(solids);
                bu_ptbl_free(combs);
                bu_ptbl_free(combs_outside_of_tree);
-               bu_vls_free(&plan_string);
                return GED_ERROR;
            }
        }
@@ -373,19 +370,15 @@
            if (db_delete(gedp->ged_wdbp->dbip, (*dp_curr)) != 0 || 
db_dirdelete(gedp->ged_wdbp->dbip, (*dp_curr)) == 0) {
                bu_vls_trunc(gedp->ged_result_str, 0);
            } else {
-               db_free_full_path_list(path_list);
                bu_ptbl_free(combs);
                bu_ptbl_free(combs_outside_of_tree);
-               bu_vls_free(&plan_string);
                return GED_ERROR;
            }
        }
     }
 
-    db_free_full_path_list(path_list);
     bu_ptbl_free(combs);
     bu_ptbl_free(combs_outside_of_tree);
-    bu_vls_free(&plan_string);
     return GED_OK;
 }
 

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


------------------------------------------------------------------------------
Get your SQL database under version control now!
Version control is standard for application code, but databases havent 
caught up. So what steps can you take to put your SQL databases under 
version control? Why should you start doing it? Read more to find out.
http://pubads.g.doubleclick.net/gampad/clk?id=49501711&iu=/4140/ostg.clktrk
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to