From a291e0dfb6e96f3cbfdf77b35dc9768ad0242a64 Mon Sep 17 00:00:00 2001 From: Robbert van der Helm Date: Fri, 17 Jun 2022 18:28:15 +0200 Subject: [PATCH] Always request flush when setting params from GUI --- src/wrapper/clap/wrapper.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/wrapper/clap/wrapper.rs b/src/wrapper/clap/wrapper.rs index 70a56a3b..b8c06c92 100644 --- a/src/wrapper/clap/wrapper.rs +++ b/src/wrapper/clap/wrapper.rs @@ -645,11 +645,10 @@ impl Wrapper

{ /// host (it will still be set on the plugin either way). pub fn queue_parameter_event(&self, event: OutputParamEvent) -> bool { let result = self.output_parameter_events.push(event).is_ok(); + + // Requesting a flush is fine even during audio processing. This avoids a race condition. match &*self.host_params.borrow() { - Some(host_params) if !self.is_processing.load(Ordering::SeqCst) => { - unsafe { (host_params.request_flush)(&*self.host_callback) }; - } - Some(_) => (), + Some(host_params) => unsafe { (host_params.request_flush)(&*self.host_callback) }, None => nih_debug_assert_failure!("The host does not support parameters? What?"), }