Add missing debug assertions for VST3 callback
This commit is contained in:
parent
0abfcb6045
commit
d2b25f8682
|
@ -582,14 +582,21 @@ impl<P: Vst3Plugin> MainThreadExecutor<Task<P>> for WrapperInner<P> {
|
|||
Task::TriggerRestart(flags) => match &*self.component_handler.borrow() {
|
||||
Some(handler) => unsafe {
|
||||
nih_debug_assert!(is_gui_thread);
|
||||
handler.restart_component(flags);
|
||||
let result = handler.restart_component(flags);
|
||||
nih_debug_assert_eq!(
|
||||
result,
|
||||
kResultOk,
|
||||
"Failed the restart request call with flags '{:?}'",
|
||||
flags
|
||||
);
|
||||
},
|
||||
None => nih_debug_assert_failure!("Component handler not yet set"),
|
||||
},
|
||||
Task::RequestResize => match &*self.plug_view.read() {
|
||||
Some(plug_view) => unsafe {
|
||||
nih_debug_assert!(is_gui_thread);
|
||||
plug_view.request_resize();
|
||||
let success = plug_view.request_resize();
|
||||
nih_debug_assert!(success, "Failed requesting a window resize");
|
||||
},
|
||||
None => nih_debug_assert_failure!("Can't resize a closed editor"),
|
||||
},
|
||||
|
|
|
@ -120,6 +120,7 @@ impl<P: Vst3Plugin> WrapperView<P> {
|
|||
/// # Safety
|
||||
///
|
||||
/// May cause memory corruption in Linux REAPER when called from outside of the `IRunLoop`.
|
||||
#[must_use]
|
||||
pub unsafe fn request_resize(&self) -> bool {
|
||||
// Don't do anything if the editor is not open, because that would be strange
|
||||
if self
|
||||
|
|
Loading…
Reference in a new issue