From cf179cdd34d59df8ddf00c3ae772c040cad5cc07 Mon Sep 17 00:00:00 2001 From: "Adam D. Ruppe" Date: Thu, 12 Nov 2020 15:44:31 -0500 Subject: [PATCH] fix cross thread bug related to terminald --- simpledisplay.d | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/simpledisplay.d b/simpledisplay.d index 3813064..f24ffcf 100644 --- a/simpledisplay.d +++ b/simpledisplay.d @@ -1683,9 +1683,11 @@ class SimpleWindow : CapableOfHandlingNativeEvent, CapableOfBeingDrawnUpon { /// Closes the window. If there are no more open windows, the event loop will terminate. void close() { if (!_closed) { - if (onClosing !is null) onClosing(); - impl.closeWindow(); - _closed = true; + runInGuiThread( { + if (onClosing !is null) onClosing(); + impl.closeWindow(); + _closed = true; + } ); } }