From 7900faeb014bed8434219a71cef23ccbe02cdd39 Mon Sep 17 00:00:00 2001 From: John Lewin Date: Thu, 30 Nov 2017 14:01:48 -0800 Subject: [PATCH] Emulator should process queued commands before exiting --- PrinterEmulator/Emulator.cs | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/PrinterEmulator/Emulator.cs b/PrinterEmulator/Emulator.cs index b2bb77391..a54010d9e 100644 --- a/PrinterEmulator/Emulator.cs +++ b/PrinterEmulator/Emulator.cs @@ -625,16 +625,21 @@ namespace MatterHackers.PrinterEmulator { if (receiveQueue.Count == 0) { - receiveResetEvent.WaitOne(); - } + if (shuttingDown) + { + return; + } - if (shuttingDown) - { - return; + receiveResetEvent.WaitOne(); } if (receiveQueue.Count == 0) { + if (shuttingDown) + { + return; + } + Thread.Sleep(10); } else