mirror of
https://git.code.sf.net/p/ngspice/ngspice
synced 2026-08-22 05:47:42 +02:00
Don't call DestroyGraph if graf id is 0
This commit is contained in:
@@ -141,7 +141,7 @@ int PS_Init(void)
|
|||||||
|
|
||||||
if (settxcolor > maxcolor || settxcolor < 0) {
|
if (settxcolor > maxcolor || settxcolor < 0) {
|
||||||
fprintf(stderr, "Bad PS text color selection %d\n", settxcolor);
|
fprintf(stderr, "Bad PS text color selection %d\n", settxcolor);
|
||||||
fprintf(stderr, " Maximum for hcopypstxcolor is %d\n", maxcolor - 1);
|
fprintf(stderr, " Maximum for hcopypstxcolor is %d\n\n", maxcolor - 1);
|
||||||
colorflag = 0;
|
colorflag = 0;
|
||||||
dispdev->numcolors = 2;
|
dispdev->numcolors = 2;
|
||||||
}
|
}
|
||||||
@@ -149,7 +149,7 @@ int PS_Init(void)
|
|||||||
if (setbgcolor > maxcolor || setbgcolor < 0) {
|
if (setbgcolor > maxcolor || setbgcolor < 0) {
|
||||||
fprintf(stderr, "Bad PS background color selection %d\n", setbgcolor);
|
fprintf(stderr, "Bad PS background color selection %d\n", setbgcolor);
|
||||||
fprintf(stderr, " Maximum for hcopypscolor is %d\n", maxcolor - 1);
|
fprintf(stderr, " Maximum for hcopypscolor is %d\n", maxcolor - 1);
|
||||||
fprintf(stderr, " Set to 1 (white)\n");
|
fprintf(stderr, " Set to 1 (white)\n\n");
|
||||||
setbgcolor = 1;
|
setbgcolor = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -327,7 +327,8 @@ int PS_Close(void)
|
|||||||
* and reset currentgraph to graphid 1, if possible
|
* and reset currentgraph to graphid 1, if possible
|
||||||
*/
|
*/
|
||||||
if (!screenflag) {
|
if (!screenflag) {
|
||||||
DestroyGraph(hcopygraphid);
|
if (hcopygraphid > 0)
|
||||||
|
DestroyGraph(hcopygraphid);
|
||||||
currentgraph = FindGraph(1);
|
currentgraph = FindGraph(1);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user