From e8df50f010f398bea5e589718e2953d0e79df579 Mon Sep 17 00:00:00 2001 From: alemi Date: Sat, 18 Jun 2022 19:36:41 +0200 Subject: [PATCH] fix: also remove sources from panel when deleted --- src/app/mod.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/app/mod.rs b/src/app/mod.rs index 8180464..5ceec67 100644 --- a/src/app/mod.rs +++ b/src/app/mod.rs @@ -230,6 +230,11 @@ impl eframe::App for App { if let Err(e) = self.data.storage.lock().expect("Storage Mutex poisoned").delete_panel(panels[i].id) { error!(target: "ui", "Could not delete panel : {:?}", e); } else { + for source in self.data.sources.write().expect("Sources RwLock poisoned").iter_mut() { + if source.panel_id == panels[i].id { + source.panel_id = -1; + } + } panels.remove(i); } } else if let Some(i) = to_swap {