fix: pass flag to clone
This commit is contained in:
+1
-1
@@ -161,7 +161,7 @@ impl AudioVisualizer {
|
|||||||
let bar_data = Arc::new(Mutex::new(vec![0; num_bars]));
|
let bar_data = Arc::new(Mutex::new(vec![0; num_bars]));
|
||||||
let bar_data_clone = Arc::clone(&bar_data);
|
let bar_data_clone = Arc::clone(&bar_data);
|
||||||
let stop_flag = Arc::new(AtomicBool::new(false));
|
let stop_flag = Arc::new(AtomicBool::new(false));
|
||||||
let stop_clone = Arc::new(AtomicBool::new(false));
|
let stop_clone = Arc::new(AtomicBool::new(&stop_flag));
|
||||||
|
|
||||||
thread::spawn(move || {
|
thread::spawn(move || {
|
||||||
if let Err(e) = Self::run_audio_loop(bar_data_clone, num_bars, stop_clone) {
|
if let Err(e) = Self::run_audio_loop(bar_data_clone, num_bars, stop_clone) {
|
||||||
|
|||||||
Reference in New Issue
Block a user