aboutsummaryrefslogtreecommitdiffstats
path: root/ui/qt/models/interface_tree_cache_model.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'ui/qt/models/interface_tree_cache_model.cpp')
-rw-r--r--ui/qt/models/interface_tree_cache_model.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/ui/qt/models/interface_tree_cache_model.cpp b/ui/qt/models/interface_tree_cache_model.cpp
index 3c1a6aa7d8..fea9020066 100644
--- a/ui/qt/models/interface_tree_cache_model.cpp
+++ b/ui/qt/models/interface_tree_cache_model.cpp
@@ -595,7 +595,9 @@ void InterfaceTreeCacheModel::deleteDevice(const QModelIndex &index)
}
else
{
- g_array_remove_index(global_capture_opts.all_ifaces, row);
+ interface_t *device = &g_array_index(global_capture_opts.all_ifaces, interface_t, row);
+ capture_opts_free_interface_t(device);
+ global_capture_opts.all_ifaces = g_array_remove_index(global_capture_opts.all_ifaces, row);
emit endRemoveRows();
wsApp->emitAppSignal(WiresharkApplication::LocalInterfacesChanged);
}