From e431591d418fc528b95f769e20f6dead38e521ad Mon Sep 17 00:00:00 2001 From: Jean Pierre Cimalando Date: Wed, 3 Feb 2021 16:00:45 +0100 Subject: [PATCH] Clear OSC queue on editor closed --- editor/src/editor/Editor.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/editor/src/editor/Editor.cpp b/editor/src/editor/Editor.cpp index 69d0f0ff..a8a90650 100644 --- a/editor/src/editor/Editor.cpp +++ b/editor/src/editor/Editor.cpp @@ -114,6 +114,7 @@ struct Editor::Impl : EditorController::Receiver, IControlListener { // queued OSC API; sends OSC with intermediate delay between messages // to prevent message bursts overloading the buffer void sendQueuedOSC(const char* path, const char* sig, const sfizz_arg_t* args); + void clearQueuedOSC(); void tickOSCQueue(CVSTGUITimer* timer); std::queue oscSendQueue_; SharedPointer oscSendQueueTimer_; @@ -218,6 +219,8 @@ void Editor::close() { Impl& impl = *impl_; + impl.clearQueuedOSC(); + if (impl.frame_) { impl.frame_->removeView(impl.mainView_.get(), false); impl.frame_ = nullptr; @@ -461,6 +464,12 @@ void Editor::Impl::sendQueuedOSC(const char* path, const char* sig, const sfizz_ oscSendQueueTimer_->start(); } +void Editor::Impl::clearQueuedOSC() +{ + while (!oscSendQueue_.empty()) + oscSendQueue_.pop(); +} + void Editor::Impl::tickOSCQueue(CVSTGUITimer* timer) { if (oscSendQueue_.empty()) {