Skip to content

Commit

Permalink
Explain why wdb uses local ged containers
Browse files Browse the repository at this point in the history
Figured out what wdb_obj is doing with its local struct ged containers -
they're deliberately avoiding the need to reference global MGED state in
this logic.  Update comments.
  • Loading branch information
starseeker committed Nov 22, 2024
1 parent d789f45 commit 8d78d21
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/mged/wdb_obj.c
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ wdb_make_bb_cmd(struct rt_wdb *wdbp,
struct rt_db_internal new_intern;
const char *new_name;
int use_air = 0;
struct ged ged;
struct ged ged; // Use a local ged struct to avoid needing global MGED state

WDB_TCL_CHECK_READ_ONLY;

Expand All @@ -320,7 +320,6 @@ wdb_make_bb_cmd(struct rt_wdb *wdbp,
return TCL_ERROR;
}

/*XXX Temporary. TODO - why are we not using the applications GEDP here? */
GED_INIT(&ged, wdbp);

i = 1;
Expand Down Expand Up @@ -1950,12 +1949,12 @@ int
wdb_cmd(ClientData clientData, Tcl_Interp *interp, int argc, const char *argv[])
{
struct rt_wdb *wdbp = (struct rt_wdb *)clientData;
struct ged ged;
RT_CHECK_WDB(wdbp);
struct ged ged; // Use a local ged struct to avoid needing global MGED state
struct bu_hook_list save_hook_list = BU_HOOK_LIST_INIT_ZERO;
int ret;

/* look for the new libged commands before trying one of the old ones */
/* TODO - why are we not using the applications GEDP here? */
GED_INIT(&ged, wdbp);

bu_log_hook_save_all(&save_hook_list);
Expand Down

0 comments on commit 8d78d21

Please sign in to comment.