From 30aba21d91b244b2f890e304abc7b1ce605325cf Mon Sep 17 00:00:00 2001 From: h_vogt Date: Thu, 1 May 2008 16:53:30 +0000 Subject: [PATCH] [ 1885979 ] Segmentation fault on plot window maximize after hardcopy: debugged --- src/frontend/com_hardcopy.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/frontend/com_hardcopy.c b/src/frontend/com_hardcopy.c index 9734253bc..0db88191f 100644 --- a/src/frontend/com_hardcopy.c +++ b/src/frontend/com_hardcopy.c @@ -8,6 +8,7 @@ #include #include #include +#include "ftedbgra.h" #include "plotting/plotit.h" #include "plotting/graphdb.h" @@ -60,6 +61,10 @@ com_hardcopy(wordlist *wl) /* enable screen plot selection for these display types */ foundit = 0; + /* save current graphics context, because plotit() will create a new + currentgraph */ + PushGraphContext(currentgraph); + #ifndef X_DISPLAY_MISSING if (!wl && hc_button) { @@ -166,5 +171,8 @@ com_hardcopy(wordlist *wl) if (tempf && *device) (void) unlink(fname); + /* restore previous graphics context by retrieving the previous currentgraph */ + PopGraphContext(); + return; }