bug fix: use after free

This commit is contained in:
canpadawan
2016-07-08 11:01:53 +02:00
parent 6cd79c7f71
commit 5162769712
3 changed files with 13 additions and 4 deletions
+9
View File
@@ -3,6 +3,15 @@
#include <QFile> #include <QFile>
#include "utility.h" #include "utility.h"
CANFrameModel::~CANFrameModel()
{
frames.clear();
filteredFrames.clear();
filters.clear();
}
int CANFrameModel::rowCount(const QModelIndex &parent) const int CANFrameModel::rowCount(const QModelIndex &parent) const
{ {
Q_UNUSED(parent); Q_UNUSED(parent);
+1
View File
@@ -16,6 +16,7 @@ class CANFrameModel: public QAbstractTableModel
public: public:
CANFrameModel(QObject *parent = 0); CANFrameModel(QObject *parent = 0);
virtual ~CANFrameModel();
int rowCount(const QModelIndex &parent = QModelIndex()) const; int rowCount(const QModelIndex &parent = QModelIndex()) const;
QVariant data(const QModelIndex &index, int role) const; QVariant data(const QModelIndex &index, int role) const;
+3 -4
View File
@@ -273,12 +273,11 @@ MainWindow::~MainWindow()
snifferWindow = NULL; snifferWindow = NULL;
} }
delete elapsedTime;
delete ui;
delete dbcHandler;
model->clearFrames();
delete model; delete model;
delete elapsedTime;
delete dbcHandler;
delete ui;
} }
void MainWindow::exitApp() void MainWindow::exitApp()