Qt: Fix memory leak for CaptureEvent

Make the argument to the events a non-memory object

Change-Id: I46d8c24415aa2bc48b2a2d3b1fccffa6956d08b5
Reviewed-on: https://code.wireshark.org/review/26671
Reviewed-by: Roland Knall <rknall@gmail.com>
This commit is contained in:
Roland Knall 2018-03-28 10:04:50 +02:00
parent febaa4f119
commit 57bf7e4347
27 changed files with 117 additions and 107 deletions

View File

@ -53,6 +53,14 @@ CaptureEvent::CaptureEvent(Context ctx, EventType evt, capture_session * session
qDebug() << "CaptureEvent [" << ctx <<"]: " << evt << " with session";
}
CaptureEvent::CaptureEvent(const CaptureEvent &ce)
{
_ctx = ce._ctx;
_evt = ce._evt;
_session = ce._session;
_filePath = ce._filePath;
}
CaptureEvent::Context CaptureEvent::captureContext() const
{ return _ctx; }
@ -195,50 +203,50 @@ void CaptureFile::captureFileEvent(int event, gpointer data)
switch(event) {
case(cf_cb_file_opened):
cap_file_ = (capture_file *) data;
emit captureEvent(new CaptureEvent(CaptureEvent::File, CaptureEvent::Opened));
emit captureEvent(CaptureEvent(CaptureEvent::File, CaptureEvent::Opened));
break;
case(cf_cb_file_closing):
file_state_ = tr(" [closing]");
emit captureEvent(new CaptureEvent(CaptureEvent::File, CaptureEvent::Closing));
emit captureEvent(CaptureEvent(CaptureEvent::File, CaptureEvent::Closing));
break;
case(cf_cb_file_closed):
file_state_ = tr(" [closed]");
emit captureEvent(new CaptureEvent(CaptureEvent::File, CaptureEvent::Closed));
emit captureEvent(CaptureEvent(CaptureEvent::File, CaptureEvent::Closed));
cap_file_ = NULL;
file_name_ = no_capture_file_;
file_state_ = QString();
break;
case(cf_cb_file_read_started):
emit captureEvent(new CaptureEvent(CaptureEvent::File, CaptureEvent::Started));
emit captureEvent(CaptureEvent(CaptureEvent::File, CaptureEvent::Started));
break;
case(cf_cb_file_read_finished):
emit captureEvent(new CaptureEvent(CaptureEvent::File, CaptureEvent::Finished));
emit captureEvent(CaptureEvent(CaptureEvent::File, CaptureEvent::Finished));
break;
case(cf_cb_file_reload_started):
emit captureEvent(new CaptureEvent(CaptureEvent::Reload, CaptureEvent::Started));
emit captureEvent(CaptureEvent(CaptureEvent::Reload, CaptureEvent::Started));
break;
case(cf_cb_file_reload_finished):
emit captureEvent(new CaptureEvent(CaptureEvent::Reload, CaptureEvent::Finished));
emit captureEvent(CaptureEvent(CaptureEvent::Reload, CaptureEvent::Finished));
break;
case(cf_cb_file_rescan_started):
emit captureEvent(new CaptureEvent(CaptureEvent::Rescan, CaptureEvent::Started));
emit captureEvent(CaptureEvent(CaptureEvent::Rescan, CaptureEvent::Started));
break;
case(cf_cb_file_rescan_finished):
emit captureEvent(new CaptureEvent(CaptureEvent::Rescan, CaptureEvent::Finished));
emit captureEvent(CaptureEvent(CaptureEvent::Rescan, CaptureEvent::Finished));
break;
case(cf_cb_file_retap_started):
emit captureEvent(new CaptureEvent(CaptureEvent::Retap, CaptureEvent::Started));
emit captureEvent(CaptureEvent(CaptureEvent::Retap, CaptureEvent::Started));
break;
case(cf_cb_file_retap_finished):
/* Flush any pending tapped packet before emitting captureFileRetapFinished() */
emit captureEvent(new CaptureEvent(CaptureEvent::Retap, CaptureEvent::Finished));
emit captureEvent(new CaptureEvent(CaptureEvent::Retap, CaptureEvent::Flushed));
emit captureEvent(CaptureEvent(CaptureEvent::Retap, CaptureEvent::Finished));
emit captureEvent(CaptureEvent(CaptureEvent::Retap, CaptureEvent::Flushed));
break;
case(cf_cb_file_merge_started):
emit captureEvent(new CaptureEvent(CaptureEvent::Merge, CaptureEvent::Started));
emit captureEvent(CaptureEvent(CaptureEvent::Merge, CaptureEvent::Started));
break;
case(cf_cb_file_merge_finished):
emit captureEvent(new CaptureEvent(CaptureEvent::Merge, CaptureEvent::Finished));
emit captureEvent(CaptureEvent(CaptureEvent::Merge, CaptureEvent::Finished));
break;
case(cf_cb_file_fast_save_finished):
@ -248,17 +256,17 @@ void CaptureFile::captureFileEvent(int event, gpointer data)
case(cf_cb_file_save_started):
{
emit captureEvent(new CaptureEvent(CaptureEvent::Save, CaptureEvent::Started, QString((const char *)data)));
emit captureEvent(CaptureEvent(CaptureEvent::Save, CaptureEvent::Started, QString((const char *)data)));
break;
}
case(cf_cb_file_save_finished):
emit captureEvent(new CaptureEvent(CaptureEvent::Save, CaptureEvent::Finished));
emit captureEvent(CaptureEvent(CaptureEvent::Save, CaptureEvent::Finished));
break;
case(cf_cb_file_save_failed):
emit captureEvent(new CaptureEvent(CaptureEvent::Save, CaptureEvent::Failed));
emit captureEvent(CaptureEvent(CaptureEvent::Save, CaptureEvent::Failed));
break;
case(cf_cb_file_save_stopped):
emit captureEvent(new CaptureEvent(CaptureEvent::Save, CaptureEvent::Stopped));
emit captureEvent(CaptureEvent(CaptureEvent::Save, CaptureEvent::Stopped));
break;
default:
@ -276,34 +284,34 @@ void CaptureFile::captureSessionEvent(int event, capture_session *cap_session)
#else
switch(event) {
case(capture_cb_capture_prepared):
emit captureEvent(new CaptureEvent(CaptureEvent::Capture, CaptureEvent::Prepared, cap_session));
emit captureEvent(CaptureEvent(CaptureEvent::Capture, CaptureEvent::Prepared, cap_session));
cap_file_ = cap_session->cf;
break;
case(capture_cb_capture_update_started):
emit captureEvent(new CaptureEvent(CaptureEvent::Update, CaptureEvent::Started, cap_session));
emit captureEvent(CaptureEvent(CaptureEvent::Update, CaptureEvent::Started, cap_session));
break;
case(capture_cb_capture_update_continue):
emit captureEvent(new CaptureEvent(CaptureEvent::Update, CaptureEvent::Continued, cap_session));
emit captureEvent(CaptureEvent(CaptureEvent::Update, CaptureEvent::Continued, cap_session));
break;
case(capture_cb_capture_update_finished):
emit captureEvent(new CaptureEvent(CaptureEvent::Update, CaptureEvent::Finished, cap_session));
emit captureEvent(CaptureEvent(CaptureEvent::Update, CaptureEvent::Finished, cap_session));
break;
case(capture_cb_capture_fixed_started):
emit captureEvent(new CaptureEvent(CaptureEvent::Fixed, CaptureEvent::Started, cap_session));
emit captureEvent(CaptureEvent(CaptureEvent::Fixed, CaptureEvent::Started, cap_session));
break;
case(capture_cb_capture_fixed_continue):
emit captureEvent(new CaptureEvent(CaptureEvent::Fixed, CaptureEvent::Continued, cap_session));
emit captureEvent(CaptureEvent(CaptureEvent::Fixed, CaptureEvent::Continued, cap_session));
break;
case(capture_cb_capture_fixed_finished):
emit captureEvent(new CaptureEvent(CaptureEvent::Fixed, CaptureEvent::Finished, cap_session));
emit captureEvent(CaptureEvent(CaptureEvent::Fixed, CaptureEvent::Finished, cap_session));
break;
case(capture_cb_capture_stopping):
/* Beware: this state won't be called, if the capture child
* closes the capturing on it's own! */
emit captureEvent(new CaptureEvent(CaptureEvent::Capture, CaptureEvent::Stopping, cap_session));
emit captureEvent(CaptureEvent(CaptureEvent::Capture, CaptureEvent::Stopping, cap_session));
break;
case(capture_cb_capture_failed):
emit captureEvent(new CaptureEvent(CaptureEvent::Capture, CaptureEvent::Failed, cap_session));
emit captureEvent(CaptureEvent(CaptureEvent::Capture, CaptureEvent::Failed, cap_session));
break;
default:
qWarning() << "main_capture_callback: event " << event << " unknown";

View File

@ -22,9 +22,9 @@ typedef struct _capture_session capture_session;
struct _packet_info;
class CaptureEvent : public QObject
class CaptureEvent
{
Q_OBJECT
public:
enum Context {
#ifdef HAVE_LIBPCAP
@ -58,6 +58,8 @@ public:
CaptureEvent(Context ctx, EventType evt, QString file);
CaptureEvent(Context ctx, EventType evt, capture_session * session);
CaptureEvent(const CaptureEvent &ce);
Context captureContext() const;
EventType eventType() const;
QString filePath() const;
@ -129,7 +131,7 @@ public:
gpointer window();
signals:
void captureEvent(CaptureEvent *);
void captureEvent(CaptureEvent);
public slots:
/** Retap the capture file. Convenience wrapper for cf_retap_packets.

View File

@ -102,8 +102,8 @@ ExpertInfoDialog::ExpertInfoDialog(QWidget &parent, CaptureFile &capture_file) :
ctx_menu_.addAction(expand);
connect(expand, SIGNAL(triggered()), this, SLOT(expandTree()));
connect(&cap_file_, SIGNAL(captureEvent(CaptureEvent *)),
this, SLOT(captureEvent(CaptureEvent *)));
connect(&cap_file_, SIGNAL(captureEvent(CaptureEvent)),
this, SLOT(captureEvent(CaptureEvent)));
setDisplayFilter();
QTimer::singleShot(0, this, SLOT(retapPackets()));
}
@ -151,11 +151,11 @@ void ExpertInfoDialog::retapPackets()
cap_file_.retapPackets();
}
void ExpertInfoDialog::captureEvent(CaptureEvent *e)
void ExpertInfoDialog::captureEvent(CaptureEvent e)
{
if (e->captureContext() == CaptureEvent::Retap)
if (e.captureContext() == CaptureEvent::Retap)
{
switch (e->eventType())
switch (e.eventType())
{
case CaptureEvent::Started:
ui->limitCheckBox->setEnabled(false);

View File

@ -53,7 +53,7 @@ private:
private slots:
void retapPackets();
void captureEvent(CaptureEvent *e);
void captureEvent(CaptureEvent e);
void updateWidgets();

View File

@ -28,13 +28,13 @@ ExportObjectAction::ExportObjectAction(QObject *parent, register_eo_t *eo) :
}
}
void ExportObjectAction::captureFileEvent(CaptureEvent *e)
void ExportObjectAction::captureFileEvent(CaptureEvent e)
{
if ( e->captureContext() == CaptureEvent::File )
if ( e.captureContext() == CaptureEvent::File )
{
if ( e->eventType() == CaptureEvent::Opened )
if ( e.eventType() == CaptureEvent::Opened )
setEnabled(true);
else if ( e->eventType() == CaptureEvent::Closed )
else if ( e.eventType() == CaptureEvent::Closed )
setEnabled(false);
}
}

View File

@ -30,7 +30,7 @@ public:
register_eo_t* exportObject() {return eo_;}
public slots:
void captureFileEvent(CaptureEvent *e);
void captureFileEvent(CaptureEvent e);
private:
register_eo_t *eo_;

View File

@ -113,10 +113,10 @@ void ExportObjectDialog::accept()
// Don't close the dialog.
}
void ExportObjectDialog::captureEvent(CaptureEvent *e)
void ExportObjectDialog::captureEvent(CaptureEvent e)
{
if ((e->captureContext() == CaptureEvent::File) &&
(e->eventType() == CaptureEvent::Closing))
if ((e.captureContext() == CaptureEvent::File) &&
(e.eventType() == CaptureEvent::Closing))
{
close();
}

View File

@ -41,7 +41,7 @@ public slots:
private slots:
void accept();
void captureEvent(CaptureEvent *e);
void captureEvent(CaptureEvent e);
void on_buttonBox_helpRequested();
void on_buttonBox_clicked(QAbstractButton *button);

View File

@ -960,10 +960,10 @@ bool FollowStreamDialog::follow(QString previous_filter, bool use_stream_index,
return true;
}
void FollowStreamDialog::captureEvent(CaptureEvent *e)
void FollowStreamDialog::captureEvent(CaptureEvent e)
{
if ((e->captureContext() == CaptureEvent::File) &&
(e->eventType() == CaptureEvent::Closing)) {
if ((e.captureContext() == CaptureEvent::File) &&
(e.eventType() == CaptureEvent::Closing)) {
QString tooltip = tr("File closed.");
ui->streamNumberSpinBox->setToolTip(tooltip);
ui->streamNumberLabel->setToolTip(tooltip);

View File

@ -44,7 +44,7 @@ public:
bool follow(QString previous_filter = QString(), bool use_stream_index = false, int stream_num = -1);
public slots:
void captureEvent(CaptureEvent *e);
void captureEvent(CaptureEvent e);
protected:
bool eventFilter(QObject *obj, QEvent *event);

View File

@ -415,10 +415,10 @@ Iax2AnalysisDialog::~Iax2AnalysisDialog()
delete rev_tempfile_;
}
void Iax2AnalysisDialog::captureEvent(CaptureEvent *e)
void Iax2AnalysisDialog::captureEvent(CaptureEvent e)
{
if ((e->captureContext() == CaptureEvent::File) &&
(e->eventType() == CaptureEvent::Closing))
if ((e.captureContext() == CaptureEvent::File) &&
(e.eventType() == CaptureEvent::Closing))
{
updateWidgets();
}

View File

@ -54,7 +54,7 @@ signals:
void goToPacket(int packet_num);
protected slots:
void captureEvent(CaptureEvent *e);
void captureEvent(CaptureEvent e);
virtual void updateWidgets();
private slots:

View File

@ -1960,10 +1960,10 @@ void IOGraph::scaleGraphData(DataMap &map, int scalar)
}
}
void IOGraph::captureEvent(CaptureEvent *e)
void IOGraph::captureEvent(CaptureEvent e)
{
if ((e->captureContext() == CaptureEvent::File) &&
(e->eventType() == CaptureEvent::Closing))
if ((e.captureContext() == CaptureEvent::File) &&
(e.eventType() == CaptureEvent::Closing))
{
remove_tap_listener(this);
}

View File

@ -79,7 +79,7 @@ public:
public slots:
void recalcGraphData(capture_file *cap_file, bool enable_scaling);
void captureEvent(CaptureEvent *e);
void captureEvent(CaptureEvent e);
void reloadValueUnitField();
signals:

View File

@ -632,26 +632,26 @@ void MainStatusBar::manageProfile()
}
}
void MainStatusBar::captureEventHandler(CaptureEvent * ev)
void MainStatusBar::captureEventHandler(CaptureEvent ev)
{
switch(ev->captureContext())
switch(ev.captureContext())
{
#ifdef HAVE_LIBPCAP
case CaptureEvent::Update:
switch ( ev->eventType() )
switch ( ev.eventType() )
{
case CaptureEvent::Continued:
updateCaptureStatistics(ev->capSession());
updateCaptureStatistics(ev.capSession());
break;
default:
break;
}
break;
case CaptureEvent::Fixed:
switch ( ev->eventType() )
switch ( ev.eventType() )
{
case CaptureEvent::Continued:
updateCaptureFixedStatistics(ev->capSession());
updateCaptureFixedStatistics(ev.capSession());
break;
default:
break;
@ -659,7 +659,7 @@ void MainStatusBar::captureEventHandler(CaptureEvent * ev)
break;
#endif
case CaptureEvent::Save:
switch ( ev->eventType() )
switch ( ev.eventType() )
{
case CaptureEvent::Finished:
case CaptureEvent::Failed:

View File

@ -87,7 +87,7 @@ public slots:
void updateCaptureStatistics(capture_session * cap_session);
void updateCaptureFixedStatistics(capture_session * cap_session);
void captureEventHandler(CaptureEvent *ev);
void captureEventHandler(CaptureEvent ev);
private slots:
void pushPacketStatus(const QString &message);

View File

@ -539,12 +539,12 @@ MainWindow::MainWindow(QWidget *parent) :
setTabOrder(df_combo_box_->lineEdit(), packet_list_);
setTabOrder(packet_list_, proto_tree_);
connect(&capture_file_, SIGNAL(captureEvent(CaptureEvent *)),
this, SLOT(captureEventHandler(CaptureEvent *)));
connect(&capture_file_, SIGNAL(captureEvent(CaptureEvent *)),
wsApp, SLOT(captureEventHandler(CaptureEvent *)));
connect(&capture_file_, SIGNAL(captureEvent(CaptureEvent *)),
main_ui_->statusBar, SLOT(captureEventHandler(CaptureEvent *)));
connect(&capture_file_, SIGNAL(captureEvent(CaptureEvent)),
this, SLOT(captureEventHandler(CaptureEvent)));
connect(&capture_file_, SIGNAL(captureEvent(CaptureEvent)),
wsApp, SLOT(captureEventHandler(CaptureEvent)));
connect(&capture_file_, SIGNAL(captureEvent(CaptureEvent)),
main_ui_->statusBar, SLOT(captureEventHandler(CaptureEvent)));
connect(wsApp, SIGNAL(columnsChanged()),
packet_list_, SLOT(columnsChanged()));

View File

@ -331,7 +331,7 @@ public slots:
private slots:
void captureEventHandler(CaptureEvent * ev);
void captureEventHandler(CaptureEvent ev);
// Manually connected slots (no "on_<object>_<signal>").

View File

@ -749,12 +749,12 @@ void MainWindow::captureCaptureFailed(capture_session *) {
// Callbacks from cfile.c and file.c via CaptureFile::captureFileCallback
void MainWindow::captureEventHandler(CaptureEvent * ev)
void MainWindow::captureEventHandler(CaptureEvent ev)
{
switch (ev->captureContext()) {
switch (ev.captureContext()) {
case CaptureEvent::File:
switch (ev->eventType()) {
switch (ev.eventType()) {
case CaptureEvent::Opened:
captureFileOpened();
break;
@ -776,7 +776,7 @@ void MainWindow::captureEventHandler(CaptureEvent * ev)
break;
case CaptureEvent::Reload:
switch (ev->eventType()) {
switch (ev.eventType()) {
case CaptureEvent::Started:
captureFileReadStarted(tr("Reloading"));
break;
@ -789,7 +789,7 @@ void MainWindow::captureEventHandler(CaptureEvent * ev)
break;
case CaptureEvent::Rescan:
switch (ev->eventType()) {
switch (ev.eventType()) {
case CaptureEvent::Started:
setMenusForCaptureFile(true);
captureFileReadStarted(tr("Rescanning"));
@ -803,7 +803,7 @@ void MainWindow::captureEventHandler(CaptureEvent * ev)
break;
case CaptureEvent::Retap:
switch (ev->eventType()) {
switch (ev.eventType()) {
case CaptureEvent::Started:
freeze();
break;
@ -819,7 +819,7 @@ void MainWindow::captureEventHandler(CaptureEvent * ev)
break;
case CaptureEvent::Merge:
switch (ev->eventType()) {
switch (ev.eventType()) {
case CaptureEvent::Started:
main_ui_->statusBar->popFileStatus();
main_ui_->statusBar->pushFileStatus(tr("Merging files"), QString());
@ -833,10 +833,10 @@ void MainWindow::captureEventHandler(CaptureEvent * ev)
break;
case CaptureEvent::Save:
switch (ev->eventType()) {
switch (ev.eventType()) {
case CaptureEvent::Started:
{
QFileInfo file_info(ev->filePath());
QFileInfo file_info(ev.filePath());
main_ui_->statusBar->popFileStatus();
main_ui_->statusBar->pushFileStatus(tr("Saving %1" UTF8_HORIZONTAL_ELLIPSIS).arg(file_info.baseName()));
break;
@ -848,28 +848,28 @@ void MainWindow::captureEventHandler(CaptureEvent * ev)
#ifdef HAVE_LIBPCAP
case CaptureEvent::Capture:
switch (ev->eventType()) {
switch (ev.eventType()) {
case CaptureEvent::Prepared:
captureCapturePrepared(ev->capSession());
captureCapturePrepared(ev.capSession());
break;
case CaptureEvent::Stopping:
capture_stopping_ = true;
setMenusForCaptureStopping();
break;
case CaptureEvent::Failed:
captureCaptureFailed(ev->capSession());
captureCaptureFailed(ev.capSession());
default:
break;
}
break;
case CaptureEvent::Update:
switch (ev->eventType()) {
switch (ev.eventType()) {
case CaptureEvent::Started:
captureCaptureUpdateStarted(ev->capSession());
captureCaptureUpdateStarted(ev.capSession());
break;
case CaptureEvent::Finished:
captureCaptureUpdateFinished(ev->capSession());
captureCaptureUpdateFinished(ev.capSession());
break;
default:
break;
@ -877,9 +877,9 @@ void MainWindow::captureEventHandler(CaptureEvent * ev)
break;
case CaptureEvent::Fixed:
switch (ev->eventType()) {
switch (ev.eventType()) {
case CaptureEvent::Finished:
captureCaptureFixedFinished(ev->capSession());
captureCaptureFixedFinished(ev.capSession());
break;
default:
break;

View File

@ -445,10 +445,10 @@ void MulticastStatisticsDialog::fillTree()
updateWidgets();
}
void MulticastStatisticsDialog::captureEvent(CaptureEvent *e)
void MulticastStatisticsDialog::captureEvent(CaptureEvent e)
{
if ((e->captureContext() == CaptureEvent::File) &&
(e->eventType() == CaptureEvent::Closing))
if ((e.captureContext() == CaptureEvent::File) &&
(e.eventType() == CaptureEvent::Closing))
{
/* Remove the stream tap listener */
remove_tap_listener_mcast_stream(tapinfo_);

View File

@ -42,7 +42,7 @@ private slots:
void updateWidgets();
void updateMulticastParameters();
virtual void fillTree();
void captureEvent(CaptureEvent *e);
void captureEvent(CaptureEvent e);
};
#endif // MULTICASTSTATISTICSDIALOG_H

View File

@ -218,11 +218,11 @@ void TrafficTableDialog::on_displayFilterCheckBox_toggled(bool checked)
cap_file_.retapPackets();
}
void TrafficTableDialog::captureEvent(CaptureEvent *e)
void TrafficTableDialog::captureEvent(CaptureEvent e)
{
if (e->captureContext() == CaptureEvent::Retap)
if (e.captureContext() == CaptureEvent::Retap)
{
switch (e->eventType())
switch (e.eventType())
{
case CaptureEvent::Started:
ui->displayFilterCheckBox->setEnabled(false);

View File

@ -161,7 +161,7 @@ private slots:
void on_displayFilterCheckBox_toggled(bool checked);
void setTabText(QWidget *tree, const QString &text);
void toggleTable();
void captureEvent(CaptureEvent *e);
void captureEvent(CaptureEvent e);
void copyAsCsv();
void copyAsYaml();

View File

@ -1325,14 +1325,14 @@ void WiresharkApplication::softwareUpdateShutdownRequest() {
}
#endif
void WiresharkApplication::captureEventHandler(CaptureEvent * ev)
void WiresharkApplication::captureEventHandler(CaptureEvent ev)
{
switch(ev->captureContext())
switch(ev.captureContext())
{
#ifdef HAVE_LIBPCAP
case CaptureEvent::Update:
case CaptureEvent::Fixed:
switch ( ev->eventType() )
switch ( ev.eventType() )
{
case CaptureEvent::Started:
active_captures_++;
@ -1350,7 +1350,7 @@ void WiresharkApplication::captureEventHandler(CaptureEvent * ev)
case CaptureEvent::File:
case CaptureEvent::Reload:
case CaptureEvent::Rescan:
switch ( ev->eventType() )
switch ( ev.eventType() )
{
case CaptureEvent::Started:
QTimer::singleShot(TAP_UPDATE_DEFAULT_INTERVAL / 5, this, SLOT(updateTaps()));

View File

@ -202,7 +202,7 @@ public slots:
void clearRecentCaptures();
void refreshRecentCaptures();
void captureEventHandler(CaptureEvent *);
void captureEventHandler(CaptureEvent);
private slots:
void updateTaps();

View File

@ -114,12 +114,12 @@ bool WiresharkDialog::registerTapListener(const char *tap_name, void *tap_data,
return true;
}
void WiresharkDialog::captureEvent(CaptureEvent *e)
void WiresharkDialog::captureEvent(CaptureEvent e)
{
switch (e->captureContext())
switch (e.captureContext())
{
case CaptureEvent::Retap:
switch (e->eventType())
switch (e.eventType())
{
case CaptureEvent::Started:
beginRetapPackets();
@ -132,7 +132,7 @@ void WiresharkDialog::captureEvent(CaptureEvent *e)
}
break;
case CaptureEvent::File:
switch (e->eventType())
switch (e.eventType())
{
case CaptureEvent::Closing:
captureFileClosing();

View File

@ -121,7 +121,7 @@ protected:
virtual void captureFileClosed();
protected slots:
void captureEvent(CaptureEvent *e);
void captureEvent(CaptureEvent);
private:
void setWindowTitleFromSubtitle();