mirror of https://github.com/adamdruppe/arsd.git
windows race condition
This commit is contained in:
parent
9ae769b5e8
commit
f94e51e6ba
|
@ -1745,6 +1745,7 @@ class SimpleWindow : CapableOfHandlingNativeEvent, CapableOfBeingDrawnUpon {
|
||||||
void close() {
|
void close() {
|
||||||
if (!_closed) {
|
if (!_closed) {
|
||||||
runInGuiThread( {
|
runInGuiThread( {
|
||||||
|
if(_closed) return; // another thread got to it first. this is a big FIXME like this is all pretty wtf-y
|
||||||
if (onClosing !is null) onClosing();
|
if (onClosing !is null) onClosing();
|
||||||
impl.closeWindow();
|
impl.closeWindow();
|
||||||
_closed = true;
|
_closed = true;
|
||||||
|
@ -8371,13 +8372,11 @@ bool runInGuiThread(scope void delegate() dg) @trusted {
|
||||||
if(!SimpleWindow.eventWakeUp())
|
if(!SimpleWindow.eventWakeUp())
|
||||||
throw new Error("runInGuiThread impossible; eventWakeUp failed");
|
throw new Error("runInGuiThread impossible; eventWakeUp failed");
|
||||||
|
|
||||||
if(guiThreadTerminating)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
rqm.signal.wait();
|
rqm.signal.wait();
|
||||||
|
auto t = rqm.thrown;
|
||||||
|
|
||||||
if(rqm.thrown)
|
if(t)
|
||||||
throw rqm.thrown;
|
throw t;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue