From 2233e2f82501da086f1a0da39e0da4c985d570a1 Mon Sep 17 00:00:00 2001 From: Giles Atkinson <“gatk555@gmail.com”> Date: Sat, 25 Feb 2023 09:54:04 +0000 Subject: [PATCH] Fix Bug #624 - "Destroy All Fails with an Open Plot Window" for X11. Move XftDrawDestroy() call to a point where the window still exists. --- src/frontend/plotting/x11.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/frontend/plotting/x11.c b/src/frontend/plotting/x11.c index 0b5d5f5eb..8879328ac 100644 --- a/src/frontend/plotting/x11.c +++ b/src/frontend/plotting/x11.c @@ -1189,6 +1189,9 @@ void RemoveWindow(GRAPH *graph) DEVDEP(graph).isopen = 0; /* MW. Not sure but DestroyGraph might free() too much - try Xt...() first */ XtUnmapWidget(DEVDEP(graph).shell); +#ifdef HAVE_LIBXFT + XftDrawDestroy(DEVDEP(graph).draw); +#endif XtDestroyWidget(DEVDEP(graph).shell); #ifndef HAVE_LIBXFT XFreeFont(display, DEVDEP(graph).font); @@ -1198,7 +1201,6 @@ void RemoveWindow(GRAPH *graph) #ifdef HAVE_LIBXFT XftFontClose( display, DEVDEP(graph).font0); XftFontClose( display, DEVDEP(graph).font90); - XftDrawDestroy(DEVDEP(graph).draw); XftColorFree(display, DefaultVisual(display, 0), DEVDEP(graph).cmap, &DEVDEP(graph).color); #endif }