diff --git a/ui/qt/conversation_hash_tables_dialog.cpp b/ui/qt/conversation_hash_tables_dialog.cpp index 86cb89073b..11b6cbbf0c 100644 --- a/ui/qt/conversation_hash_tables_dialog.cpp +++ b/ui/qt/conversation_hash_tables_dialog.cpp @@ -38,7 +38,7 @@ ConversationHashTablesDialog::ConversationHashTablesDialog(QWidget *parent) : { ui->setupUi(this); if (parent) loadGeometry(parent->width() * 3 / 4, parent->height() * 3 / 4); - + setAttribute(Qt::WA_DeleteOnClose, true); setWindowTitle(wsApp->windowTitleString(tr("Dissector Tables"))); QString html; diff --git a/ui/qt/display_filter_expression_dialog.cpp b/ui/qt/display_filter_expression_dialog.cpp index c63aba0432..cb0d75bfa5 100644 --- a/ui/qt/display_filter_expression_dialog.cpp +++ b/ui/qt/display_filter_expression_dialog.cpp @@ -71,6 +71,7 @@ DisplayFilterExpressionDialog::DisplayFilterExpressionDialog(QWidget *parent) : { ui->setupUi(this); if (parent) loadGeometry(parent->width() * 2 / 3, parent->height()); + setAttribute(Qt::WA_DeleteOnClose, true); setWindowTitle(wsApp->windowTitleString(tr("Display Filter Expression"))); setWindowIcon(wsApp->normalIcon()); diff --git a/ui/qt/dissector_tables_dialog.cpp b/ui/qt/dissector_tables_dialog.cpp index 07483bb113..7a1490b21b 100644 --- a/ui/qt/dissector_tables_dialog.cpp +++ b/ui/qt/dissector_tables_dialog.cpp @@ -83,7 +83,7 @@ DissectorTablesDialog::DissectorTablesDialog(QWidget *parent) : { ui->setupUi(this); if (parent) loadGeometry(parent->width() * 3 / 4, parent->height() * 3 / 4); - + setAttribute(Qt::WA_DeleteOnClose, true); setWindowTitle(wsApp->windowTitleString(tr("Dissector Tables"))); on_tableTreeWidget_itemSelectionChanged(); diff --git a/ui/qt/main_window.cpp b/ui/qt/main_window.cpp index eeab9fa92f..380ef7e357 100644 --- a/ui/qt/main_window.cpp +++ b/ui/qt/main_window.cpp @@ -66,6 +66,7 @@ DIAG_ON(frame-larger-than=) #include #include "export_dissection_dialog.h" #include "file_set_dialog.h" +#include "filter_dialog.h" #include "funnel_statistics.h" #include "import_text_dialog.h" #include "interface_toolbar.h" @@ -271,6 +272,8 @@ MainWindow::MainWindow(QWidget *parent) : , capture_interfaces_dialog_(NULL) , info_data_() #endif + , display_filter_dlg_(NULL) + , capture_filter_dlg_(NULL) #ifdef _WIN32 , pipe_timer_(NULL) #else @@ -739,12 +742,18 @@ MainWindow::~MainWindow() disconnect(main_ui_->mainStack, 0, 0, 0); #ifndef Q_OS_MAC - // file_set_dialog_ is a subclass of GeometryStateDialog. + // Below dialogs inherit GeometryStateDialog // For reasons described in geometry_state_dialog.h no parent is set when - // instantiating the dialog and as a result the object is not automatically - // freed by its parent. Free it here explicitly to avoid leak and numerous + // instantiating the dialogs and as a resul objects are not automatically + // freed by its parent. Free then here explicitly to avoid leak and numerous // Valgrind complaints. delete file_set_dialog_; + delete capture_filter_dlg_; + delete display_filter_dlg_; +#ifdef HAVE_LIBPCAP + delete capture_interfaces_dialog_; +#endif + #endif delete main_ui_; } diff --git a/ui/qt/main_window.h b/ui/qt/main_window.h index 9eeacd0f1a..2208be7fe5 100644 --- a/ui/qt/main_window.h +++ b/ui/qt/main_window.h @@ -63,6 +63,7 @@ class AccordionFrame; class ByteViewTab; class CaptureInterfacesDialog; class FileSetDialog; +class FilterDialog; class FunnelStatistics; class MainWelcome; class PacketList; @@ -179,6 +180,8 @@ private: CaptureInterfacesDialog *capture_interfaces_dialog_; info_data_t info_data_; #endif + FilterDialog *display_filter_dlg_; + FilterDialog *capture_filter_dlg_; // Pipe input gint pipe_source_; diff --git a/ui/qt/main_window_slots.cpp b/ui/qt/main_window_slots.cpp index 59e6d2ebbf..ff0c3e4163 100644 --- a/ui/qt/main_window_slots.cpp +++ b/ui/qt/main_window_slots.cpp @@ -2728,7 +2728,6 @@ void MainWindow::matchFieldFilter(FilterAction::Action action, FilterAction::Act emit filterAction(field_filter, action, filter_type); } -static FilterDialog *display_filter_dlg_ = NULL; void MainWindow::on_actionAnalyzeDisplayFilters_triggered() { if (!display_filter_dlg_) { @@ -3736,7 +3735,6 @@ void MainWindow::on_actionCaptureRestart_triggered() startCapture(); } -static FilterDialog *capture_filter_dlg_ = NULL; void MainWindow::on_actionCaptureCaptureFilters_triggered() { if (!capture_filter_dlg_) { diff --git a/ui/qt/manage_interfaces_dialog.cpp b/ui/qt/manage_interfaces_dialog.cpp index 55948bf167..b124f46302 100644 --- a/ui/qt/manage_interfaces_dialog.cpp +++ b/ui/qt/manage_interfaces_dialog.cpp @@ -87,6 +87,7 @@ ManageInterfacesDialog::ManageInterfacesDialog(QWidget *parent) : { ui->setupUi(this); loadGeometry(); + setAttribute(Qt::WA_DeleteOnClose, true); #ifdef Q_OS_MAC ui->addPipe->setAttribute(Qt::WA_MacSmallSize, true); diff --git a/ui/qt/supported_protocols_dialog.cpp b/ui/qt/supported_protocols_dialog.cpp index 0d9c582124..a49a89c7b1 100644 --- a/ui/qt/supported_protocols_dialog.cpp +++ b/ui/qt/supported_protocols_dialog.cpp @@ -53,6 +53,7 @@ SupportedProtocolsDialog::SupportedProtocolsDialog(QWidget *parent) : { ui->setupUi(this); if (parent) loadGeometry(parent->width() * 3 / 4, parent->height()); + setAttribute(Qt::WA_DeleteOnClose, true); setWindowTitle(wsApp->windowTitleString(tr("Supported Protocols"))); // Some of our names are unreasonably long.