diff main/OSCHandler.cpp @ 2529:c7554741550f

Discard rest of OSC queue when exiting from OSC
author Chris Cannam
date Wed, 29 Apr 2020 17:48:49 +0100
parents 1891812e44b2
children
line wrap: on
line diff
--- a/main/OSCHandler.cpp	Wed Apr 29 16:52:26 2020 +0100
+++ b/main/OSCHandler.cpp	Wed Apr 29 17:48:49 2020 +0100
@@ -772,6 +772,14 @@
     } else if (message.getMethod() == "quit") {
 
         SVDEBUG << "OSCHandler: Exiting abruptly" << endl;
+
+        // discard any more pending OSC messages
+        if (m_oscQueue) {
+            while (!m_oscQueue->isEmpty()) {
+                (void)m_oscQueue->readMessage();
+            }
+        }
+        
         m_documentModified = false; // so we don't ask to save
         close();