delete autoremoved clips from pool

This commit is contained in:
🪞👃🪞 2025-04-26 14:26:28 +03:00
parent a9cfaf9767
commit 7af98b7008
2 changed files with 15 additions and 3 deletions

View file

@ -103,4 +103,12 @@ impl MidiPool {
self.clip.store(index, Relaxed);
(index, clip)
}
pub fn delete_clip (&mut self, clip: &MidiClip) -> bool {
let index = self.clips.read().unwrap().iter().position(|x|*x.read().unwrap()==*clip);
if let Some(index) = index {
self.clips.write().unwrap().remove(index);
return true
}
false
}
}