fix a segfault, when invoking `destroy' while running in batch mode on unix
This commit is contained in:
parent
545e9004e9
commit
2d1e44787b
|
|
@ -1,3 +1,8 @@
|
||||||
|
2011-06-02 Robert Larice
|
||||||
|
* src/frontend/plotting/graf.c ,
|
||||||
|
* src/frontend/plotting/x11.c :
|
||||||
|
fix a segfault, when invoking `destroy' while running in batch mode on unix
|
||||||
|
|
||||||
2011-06-02 Robert Larice
|
2011-06-02 Robert Larice
|
||||||
* src/frontend/evaluate.c :
|
* src/frontend/evaluate.c :
|
||||||
fix a segfault, incorrect invocation of free()
|
fix a segfault, incorrect invocation of free()
|
||||||
|
|
|
||||||
|
|
@ -132,7 +132,6 @@ gr_init(double *xlims, double *ylims, /* The size of the screen. */
|
||||||
graph->data.ymin = ylims[0];
|
graph->data.ymin = ylims[0];
|
||||||
graph->data.ymax = ylims[1];
|
graph->data.ymax = ylims[1];
|
||||||
/* get title into plot window */
|
/* get title into plot window */
|
||||||
#ifdef HAS_WINDOWS
|
|
||||||
if (!pname)
|
if (!pname)
|
||||||
pname = "(unknown)";
|
pname = "(unknown)";
|
||||||
if (!plotname)
|
if (!plotname)
|
||||||
|
|
@ -140,7 +139,6 @@ gr_init(double *xlims, double *ylims, /* The size of the screen. */
|
||||||
comb_title = TMALLOC(char, strlen(plotname) + strlen(pname) + 3);
|
comb_title = TMALLOC(char, strlen(plotname) + strlen(pname) + 3);
|
||||||
sprintf(comb_title, "%s: %s", pname, plotname);
|
sprintf(comb_title, "%s: %s", pname, plotname);
|
||||||
graph->plotname = comb_title;
|
graph->plotname = comb_title;
|
||||||
#endif
|
|
||||||
|
|
||||||
/* note: have enum here or some better convention */
|
/* note: have enum here or some better convention */
|
||||||
if (NewViewport(graph) == 1) {
|
if (NewViewport(graph) == 1) {
|
||||||
|
|
@ -187,15 +185,7 @@ gr_init(double *xlims, double *ylims, /* The size of the screen. */
|
||||||
graph->grid.ylabel = "imag";
|
graph->grid.ylabel = "imag";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#ifndef HAS_WINDOWS
|
|
||||||
if (!pname)
|
|
||||||
pname = "(unknown)";
|
|
||||||
if (!plotname)
|
|
||||||
plotname = "(unknown)";
|
|
||||||
comb_title = TMALLOC(char, strlen(plotname) + strlen(pname) + 3);
|
|
||||||
sprintf(comb_title, "%s: %s", pname, plotname);
|
|
||||||
graph->plotname = comb_title;
|
|
||||||
#endif
|
|
||||||
gr_resize_internal(graph);
|
gr_resize_internal(graph);
|
||||||
gr_redrawgrid(graph);
|
gr_redrawgrid(graph);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -907,12 +907,16 @@ killwin(Widget w, XtPointer client_data, XtPointer call_data)
|
||||||
void
|
void
|
||||||
RemoveWindow(GRAPH *graph)
|
RemoveWindow(GRAPH *graph)
|
||||||
{
|
{
|
||||||
/* Iplots are done asynchronously */
|
if(graph->devdep) {
|
||||||
DEVDEP(graph).isopen = 0;
|
/* Iplots are done asynchronously */
|
||||||
/* MW. Not sure but DestroyGraph might free() to much - try Xt...() first */
|
DEVDEP(graph).isopen = 0;
|
||||||
XtDestroyWidget(DEVDEP(graph).shell);
|
/* MW. Not sure but DestroyGraph might free() to much - try Xt...() first */
|
||||||
|
XtDestroyWidget(DEVDEP(graph).shell);
|
||||||
|
}
|
||||||
|
|
||||||
if (graph == currentgraph)
|
if (graph == currentgraph)
|
||||||
currentgraph = NULL;
|
currentgraph = NULL;
|
||||||
|
|
||||||
DestroyGraph(graph->graphid);
|
DestroyGraph(graph->graphid);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue