This commit is contained in:
2026-02-03 03:25:31 +01:00
parent 3380e454df
commit 154cac6547
8 changed files with 125 additions and 32 deletions

View File

@@ -1,3 +1,4 @@
use arc_swap::ArcSwap;
use parking_lot::Mutex;
use rand::rngs::StdRng;
use rand::SeedableRng;
@@ -60,7 +61,7 @@ impl Default for App {
impl App {
pub fn new() -> Self {
let variables = Arc::new(Mutex::new(HashMap::new()));
let variables = Arc::new(ArcSwap::from_pointee(HashMap::new()));
let dict = Arc::new(Mutex::new(HashMap::new()));
let rng = Arc::new(Mutex::new(StdRng::seed_from_u64(0)));
let script_engine =
@@ -606,7 +607,7 @@ impl App {
link.set_tempo(tempo);
self.playback.clear_queues();
self.variables.lock().clear();
self.variables.store(Arc::new(HashMap::new()));
self.dict.lock().clear();
for (bank, pattern) in playing {