From 8d78d21b57e1399fb30701589d8255280fe143ed Mon Sep 17 00:00:00 2001 From: Clifford Yapp <238416+starseeker@users.noreply.github.com> Date: Fri, 22 Nov 2024 16:33:58 -0500 Subject: [PATCH] Explain why wdb uses local ged containers 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. --- src/mged/wdb_obj.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/mged/wdb_obj.c b/src/mged/wdb_obj.c index 2217261add..0bb26d6cf0 100644 --- a/src/mged/wdb_obj.c +++ b/src/mged/wdb_obj.c @@ -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; @@ -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; @@ -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);