Merge pull request #709 from jpcima/fix-vst-crash

Add and remove timers only when a frame is active
This commit is contained in:
JP Cimalando 2021-03-17 12:17:29 +01:00 committed by GitHub
commit d505d70433
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -245,11 +245,6 @@ Editor::Editor(EditorController& ctrl)
ctrl.decorate(&impl);
impl.createFrameContents();
uint32_t oscSendInterval = 1; // milliseconds
impl.oscSendQueueTimer_ = makeOwned<CVSTGUITimer>(
[this](CVSTGUITimer* timer) { impl_->tickOSCQueue(timer); },
oscSendInterval, false);
}
Editor::~Editor()
@ -275,6 +270,11 @@ void Editor::open(CFrame& frame)
impl_->sendQueuedOSC("/mem/buffers", "", nullptr);
}, 1000, true);
uint32_t oscSendInterval = 1; // milliseconds
impl.oscSendQueueTimer_ = makeOwned<CVSTGUITimer>(
[this](CVSTGUITimer* timer) { impl_->tickOSCQueue(timer); },
oscSendInterval, false);
// request the whole Key and CC information
impl.sendQueuedOSC("/key/slots", "", nullptr);
impl.sendQueuedOSC("/sw/last/slots", "", nullptr);
@ -286,6 +286,7 @@ void Editor::close()
Impl& impl = *impl_;
impl.clearQueuedOSC();
impl.oscSendQueueTimer_ = nullptr;
impl.memQueryTimer_ = nullptr;