[fractal/fractal-next] sidebar: disconnect signal when row is disposed



commit 0fca8b72f331c7148936fefed08b288d890b7b34
Author: Julian Sparber <julian sparber net>
Date:   Thu Sep 9 17:05:33 2021 +0200

    sidebar: disconnect signal when row is disposed

 src/session/sidebar/room_row.rs | 8 ++++++++
 1 file changed, 8 insertions(+)
---
diff --git a/src/session/sidebar/room_row.rs b/src/session/sidebar/room_row.rs
index a8234300..fba21688 100644
--- a/src/session/sidebar/room_row.rs
+++ b/src/session/sidebar/room_row.rs
@@ -77,6 +77,14 @@ mod imp {
                 _ => unimplemented!(),
             }
         }
+
+        fn dispose(&self, _obj: &Self::Type) {
+            if let Some(room) = self.room.take() {
+                if let Some(id) = self.signal_handler.take() {
+                    room.disconnect(id);
+                }
+            }
+        }
     }
 
     impl WidgetImpl for RoomRow {}


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]