From 805fa514822e441c9a5c9ff5b094517e37f7cb30 Mon Sep 17 00:00:00 2001 From: Luciano Iam Date: Thu, 13 Jan 2022 20:21:34 +0100 Subject: [PATCH] Make sure idle callback runs on same thread that created timer (macOS) --- distrho/src/DistrhoUIVST3.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/distrho/src/DistrhoUIVST3.cpp b/distrho/src/DistrhoUIVST3.cpp index ec0ad2e8..4f20c665 100644 --- a/distrho/src/DistrhoUIVST3.cpp +++ b/distrho/src/DistrhoUIVST3.cpp @@ -735,12 +735,12 @@ private: ctx.info = this; fTimer = CFRunLoopTimerCreate(kCFAllocatorDefault, CFAbsoluteTimeGetCurrent() + t, t, 0, 0, UIVst3::nativeIdleTimerCallback, &ctx); - CFRunLoopAddTimer(CFRunLoopGetMain(), fTimer, kCFRunLoopCommonModes); + CFRunLoopAddTimer(CFRunLoopGetCurrent(), fTimer, kCFRunLoopCommonModes); } void nativeIdleTimerDestroy() { - CFRunLoopRemoveTimer(CFRunLoopGetMain(), fTimer, kCFRunLoopCommonModes); + CFRunLoopRemoveTimer(CFRunLoopGetCurrent(), fTimer, kCFRunLoopCommonModes); CFRelease(fTimer); }