Skip to content

Commit

Permalink
Fix widgets not unsubscribing if type doesn't have a widget implement…
Browse files Browse the repository at this point in the history
…ation (#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
  • Loading branch information
Gold872 authored May 19, 2024
1 parent b719a48 commit 6f61560
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/widgets/network_tree/networktables_tree_row.dart
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,10 @@ class NetworkTableTreeRow {
NTWidget? widget = NTWidgetBuilder.buildNTWidgetFromModel(primary);

if (widget == null) {
primary.unSubscribe();
primary.disposeWidget(deleting: true);
primary.forceDispose();

return null;
}

Expand Down

0 comments on commit 6f61560

Please sign in to comment.