From 89718d996ecc7f7f8b9af0f3416adac6d7c83f1e Mon Sep 17 00:00:00 2001 From: "Adam D. Ruppe" Date: Wed, 20 Jan 2021 14:05:18 -0500 Subject: [PATCH] avoid problem --- simpledisplay.d | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/simpledisplay.d b/simpledisplay.d index 069f4ff..ca599a3 100644 --- a/simpledisplay.d +++ b/simpledisplay.d @@ -11544,7 +11544,10 @@ mixin DynamicLoad!(XRender, "Xrender", 1, false, true) XRenderLibrary; // now remove all registered images to prevent shared memory leaks freeImages(); - XCloseDisplay(display); + // tbh I don't know why it is doing this but like if this happens to run + // from the other thread there's frequent hanging inside here. + if(thisIsGuiThread) + XCloseDisplay(display); display = null; } }