Fix potential VST3 parking_lot allocation failure
This can happen when the process function is called from a new thread or when a new thread has been spawned.
This commit is contained in:
parent
439b9d0bbb
commit
fc9e521a85
1 changed files with 3 additions and 1 deletions
|
@ -1561,7 +1561,9 @@ impl<P: Vst3Plugin> IAudioProcessor for Wrapper<P> {
|
|||
}
|
||||
|
||||
let result = if buffer_is_valid {
|
||||
let mut plugin = self.inner.plugin.lock();
|
||||
// NOTE: `parking_lot`'s mutexes sometimes allocate because of their use of
|
||||
// thread locals
|
||||
let mut plugin = permit_alloc(|| self.inner.plugin.lock());
|
||||
// SAFETY: Shortening these borrows is safe as even if the plugin overwrites the
|
||||
// slices (which it cannot do without using unsafe code), then they
|
||||
// would still be reset on the next iteration
|
||||
|
|
Loading…
Add table
Reference in a new issue