aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ui/qt/manage_interfaces_dialog.cpp1
-rw-r--r--ui/qt/models/interface_tree_cache_model.cpp4
2 files changed, 4 insertions, 1 deletions
diff --git a/ui/qt/manage_interfaces_dialog.cpp b/ui/qt/manage_interfaces_dialog.cpp
index 5d48bdbe09..55948bf167 100644
--- a/ui/qt/manage_interfaces_dialog.cpp
+++ b/ui/qt/manage_interfaces_dialog.cpp
@@ -499,6 +499,7 @@ void ManageInterfacesDialog::on_delRemote_clicked()
interface_t *device = &g_array_index(global_capture_opts.all_ifaces, interface_t, i);
if (item->text(col_r_host_dev_).compare(device->remote_opts.remote_host_opts.remote_host))
continue;
+ capture_opts_free_interface_t(device);
global_capture_opts.all_ifaces = g_array_remove_index(global_capture_opts.all_ifaces, i);
}
delete item;
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);
}