Browse Source

destroy `const' plot in com_quit()

rlar 14 years ago
parent
commit
811bf5664a
  1. 1
      src/frontend/misccoms.c
  2. 24
      src/frontend/postcoms.c
  3. 2
      src/frontend/postcoms.h

1
src/frontend/misccoms.c

@ -79,6 +79,7 @@ com_quit(wordlist *wl)
destroy_ivars();
byemesg();
destroy_const_plot();
exit(exitcode);
}

24
src/frontend/postcoms.c

@ -22,6 +22,7 @@ Author: 1985 Wayne A. Christopher, U. C. Berkeley CAD Group
#include "quote.h"
#include "variable.h"
#include "parser/complete.h" /* va: throwaway */
#include "plotting/plotting.h"
static void killplot(struct plot *pl);
@ -856,6 +857,29 @@ killplot(struct plot *pl)
}
void
destroy_const_plot(void)
{
struct dvec *v, *nv = NULL;
struct plot *pl = &constantplot;
/* pl_dvecs, pl_scale */
for (v = pl->pl_dvecs; v; v = nv) {
nv = v->v_next;
vec_free(v);
}
wl_free(pl->pl_commands);
if (pl->pl_ccom) /* va: also tfree (memory leak) */
throwaway(pl->pl_ccom);
if (pl->pl_env) { /* The 'environment' for this plot. */
/* va: HOW to do? */
printf("va: killplot should tfree pl->pl_env=(%p)\n", pl->pl_env);
fflush(stdout);
}
}
/* delete all windows with graphs dedrived from a given plot */
static void
DelPlotWindows(struct plot *pl)

2
src/frontend/postcoms.h

@ -16,5 +16,7 @@ void com_cross(wordlist *wl);
void com_destroy(wordlist *wl);
void com_splot(wordlist *wl);
void destroy_const_plot(void);
#endif
Loading…
Cancel
Save