Optionally disallow allocations in reset function
This commit is contained in:
parent
fd8bd025c8
commit
37e1b9523b
2 changed files with 5 additions and 5 deletions
src/wrapper
|
@ -728,7 +728,7 @@ impl<P: ClapPlugin> Wrapper<P> {
|
||||||
&mut wrapper.make_process_context(Transport::new(buffer_config.sample_rate)),
|
&mut wrapper.make_process_context(Transport::new(buffer_config.sample_rate)),
|
||||||
) {
|
) {
|
||||||
// As per-the trait docs we'll always call this after the initialization function
|
// As per-the trait docs we'll always call this after the initialization function
|
||||||
plugin.reset();
|
process_wrapper(|| plugin.reset());
|
||||||
|
|
||||||
// Preallocate enough room in the output slices vector so we can convert a `*mut *mut
|
// Preallocate enough room in the output slices vector so we can convert a `*mut *mut
|
||||||
// f32` to a `&mut [&mut f32]` in the process call
|
// f32` to a `&mut [&mut f32]` in the process call
|
||||||
|
@ -774,7 +774,7 @@ impl<P: ClapPlugin> Wrapper<P> {
|
||||||
check_null_ptr!((), plugin);
|
check_null_ptr!((), plugin);
|
||||||
let wrapper = &*(plugin as *const Self);
|
let wrapper = &*(plugin as *const Self);
|
||||||
|
|
||||||
wrapper.plugin.write().reset();
|
process_wrapper(|| wrapper.plugin.write().reset());
|
||||||
}
|
}
|
||||||
|
|
||||||
unsafe extern "C" fn process(
|
unsafe extern "C" fn process(
|
||||||
|
@ -1655,7 +1655,7 @@ impl<P: ClapPlugin> Wrapper<P> {
|
||||||
&buffer_config,
|
&buffer_config,
|
||||||
&mut wrapper.make_process_context(Transport::new(buffer_config.sample_rate)),
|
&mut wrapper.make_process_context(Transport::new(buffer_config.sample_rate)),
|
||||||
);
|
);
|
||||||
plugin.reset();
|
process_wrapper(|| plugin.reset());
|
||||||
}
|
}
|
||||||
|
|
||||||
true
|
true
|
||||||
|
|
|
@ -242,7 +242,7 @@ impl<P: Vst3Plugin> IComponent for Wrapper<P> {
|
||||||
.inner
|
.inner
|
||||||
.make_process_context(Transport::new(buffer_config.sample_rate)),
|
.make_process_context(Transport::new(buffer_config.sample_rate)),
|
||||||
);
|
);
|
||||||
plugin.reset();
|
process_wrapper(|| plugin.reset());
|
||||||
}
|
}
|
||||||
|
|
||||||
kResultOk
|
kResultOk
|
||||||
|
@ -602,7 +602,7 @@ impl<P: Vst3Plugin> IAudioProcessor for Wrapper<P> {
|
||||||
.make_process_context(Transport::new(buffer_config.sample_rate)),
|
.make_process_context(Transport::new(buffer_config.sample_rate)),
|
||||||
) {
|
) {
|
||||||
// As per-the trait docs we'll always call this after the initialization function
|
// As per-the trait docs we'll always call this after the initialization function
|
||||||
plugin.reset();
|
process_wrapper(|| plugin.reset());
|
||||||
|
|
||||||
// Preallocate enough room in the output slices vector so we can convert a `*mut *mut
|
// Preallocate enough room in the output slices vector so we can convert a `*mut *mut
|
||||||
// f32` to a `&mut [&mut f32]` in the process call
|
// f32` to a `&mut [&mut f32]` in the process call
|
||||||
|
|
Loading…
Add table
Reference in a new issue