From 6f61560eec482d3682e0ff6d46b24cb0e23c35bf Mon Sep 17 00:00:00 2001 From: Gold87 <91761103+Gold872@users.noreply.github.com> Date: Sat, 18 May 2024 22:15:46 -0400 Subject: [PATCH] Fix widgets not unsubscribing if type doesn't have a widget implementation (#43) If you drag a table containing a widget that doesn't have a widget implementation, it will never unsubscribe This has the widget model be unsubscribed and disposed before returning null in the tree row's `toWidgetContainerModel()` method --- lib/widgets/network_tree/networktables_tree_row.dart | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/widgets/network_tree/networktables_tree_row.dart b/lib/widgets/network_tree/networktables_tree_row.dart index e3ae0b71..706bfbe5 100644 --- a/lib/widgets/network_tree/networktables_tree_row.dart +++ b/lib/widgets/network_tree/networktables_tree_row.dart @@ -241,6 +241,10 @@ class NetworkTableTreeRow { NTWidget? widget = NTWidgetBuilder.buildNTWidgetFromModel(primary); if (widget == null) { + primary.unSubscribe(); + primary.disposeWidget(deleting: true); + primary.forceDispose(); + return null; }