Skip to content

Commit

Permalink
Fix a couple pieces so we can draw and quit.
Browse files Browse the repository at this point in the history
  • Loading branch information
starseeker committed Nov 22, 2024
1 parent 4d83d1b commit ac27664
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 8 deletions.
20 changes: 12 additions & 8 deletions src/mged/cmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1414,8 +1414,6 @@ f_quit(ClientData clientData, Tcl_Interp *interpreter, int argc, const char *arg
MGED_CK_CMD(ctp);
struct mged_state *s = ctp->s;

BU_PUT (MGED_STATE, struct mged_state);

if (argc < 1 || 1 < argc) {
struct bu_vls vls = BU_VLS_INIT_ZERO;

Expand Down Expand Up @@ -1993,7 +1991,7 @@ cmd_tol(ClientData clientData, Tcl_Interp *interpreter, int argc, const char *ar


/* defined in chgview.c */
extern int edit_com(int argc, const char *argv[]);
extern int edit_com(struct mged_state *s, int argc, const char *argv[]);

/**
* Run ged_blast, then update the views
Expand Down Expand Up @@ -2088,20 +2086,23 @@ cmd_draw(ClientData clientData, Tcl_Interp *UNUSED(interpreter), int argc, const
gvp->gv_height = dm_get_height(DMP);
}

return edit_com(argc, argv);
return edit_com(s, argc, argv);
}


/**
* Format: ev objects
*/
int
cmd_ev(ClientData UNUSED(clientData),
cmd_ev(ClientData clientData,
Tcl_Interp *UNUSED(interpreter),
int argc,
const char *argv[])
{
return edit_com(argc, argv);
struct cmdtab *ctp = (struct cmdtab *)clientData;
MGED_CK_CMD(ctp);
struct mged_state *s = ctp->s;
return edit_com(s, argc, argv);
}


Expand All @@ -2110,12 +2111,15 @@ cmd_ev(ClientData UNUSED(clientData),
* display). Usage: E object(s)
*/
int
cmd_E(ClientData UNUSED(clientData),
cmd_E(ClientData clientData,
Tcl_Interp *UNUSED(interpreter),
int argc,
const char *argv[])
{
return edit_com(argc, argv);
struct cmdtab *ctp = (struct cmdtab *)clientData;
MGED_CK_CMD(ctp);
struct mged_state *s = ctp->s;
return edit_com(s, argc, argv);
}


Expand Down
1 change: 1 addition & 0 deletions src/mged/f_db.c
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,7 @@ f_opendb(ClientData clientData, Tcl_Interp *interpreter, int argc, const char *a

struct mged_opendb_ctx ctx;
ctx.old_dbip = NULL;
ctx.s = s;

if (argc <= 1) {
/* Invoked without args, return name of current database */
Expand Down
2 changes: 2 additions & 0 deletions src/mged/mged.c
Original file line number Diff line number Diff line change
Expand Up @@ -2551,6 +2551,8 @@ mged_finish(struct mged_state *s, int exitcode)

mged_global_variable_teardown(INTERP);

BU_PUT (MGED_STATE, struct mged_state);

/* 8.5 seems to have some bugs in their reference counting */
/* Tcl_DeleteInterp(INTERP); */

Expand Down

0 comments on commit ac27664

Please sign in to comment.