diff --git a/client/port.cpp b/client/port.cpp index 3a3aad3..f51e20b 100644 --- a/client/port.cpp +++ b/client/port.cpp @@ -609,7 +609,6 @@ bool Port::openStreams(QString fileName, bool append, QString &error) int ret; optDialog->setParent(mainWindow, Qt::Dialog); ret = optDialog->exec(); - optDialog->setParent(0, Qt::Dialog); if (ret == QDialog::Rejected) goto _user_opt_cancel; } diff --git a/common/pcapfileformat.cpp b/common/pcapfileformat.cpp index d1d0f69..036ebfd 100644 --- a/common/pcapfileformat.cpp +++ b/common/pcapfileformat.cpp @@ -44,6 +44,7 @@ PcapImportOptionsDialog::PcapImportOptionsDialog(QVariantMap *options) : QDialog(NULL) { setupUi(this); + setAttribute(Qt::WA_DeleteOnClose); options_ = options; viaPdml->setChecked(options_->value("ViaPdml").toBool()); @@ -72,13 +73,10 @@ PcapFileFormat::PcapFileFormat() importOptions_.insert("ViaPdml", true); importOptions_.insert("RecalculateCksums", true); importOptions_.insert("DoDiff", true); - - importDialog_ = NULL; } PcapFileFormat::~PcapFileFormat() { - delete importDialog_; } bool PcapFileFormat::open(const QString fileName, @@ -709,10 +707,7 @@ _exit: QDialog* PcapFileFormat::openOptionsDialog() { - if (!importDialog_) - importDialog_ = new PcapImportOptionsDialog(&importOptions_); - - return importDialog_; + return new PcapImportOptionsDialog(&importOptions_); } bool PcapFileFormat::isMyFileFormat(const QString /*fileName*/) diff --git a/common/pcapfileformat.h b/common/pcapfileformat.h index d28bb22..5e8a744 100644 --- a/common/pcapfileformat.h +++ b/common/pcapfileformat.h @@ -81,7 +81,6 @@ private: QDataStream fd_; QVariantMap importOptions_; - PcapImportOptionsDialog *importDialog_; }; extern PcapFileFormat pcapFileFormat; diff --git a/common/pcapfileimport.ui b/common/pcapfileimport.ui index c2fbf46..1fb0edc 100644 --- a/common/pcapfileimport.ui +++ b/common/pcapfileimport.ui @@ -7,7 +7,7 @@ 0 0 326 - 112 + 132