diff --git a/app/elementstablemodel.cpp b/app/elementstablemodel.cpp index c116ca7943e1a7fa328de27323b4937e5ecadf09..302b7dcc88f9a36a6554ec220a5cea317cc00c68 100644 --- a/app/elementstablemodel.cpp +++ b/app/elementstablemodel.cpp @@ -113,6 +113,8 @@ void ElementsTableModel::removeTask(Task* task){ //int row = pidVector.indexOf(key); beginRemoveRows(QModelIndex(), rowCount(), rowCount()); taskVector.removeOne(task); + free(task); + qDebug() << "free"; //pidVector.remove(row); //qDebug() << "remove " << task->print(); endRemoveRows(); @@ -166,9 +168,9 @@ void ElementsTableModel::update() timer.start(); //QVector<Task*>::iterator it; - for (int i =0; i < taskVector.size(); ++i) + for (int j =0; j < taskVector.size(); ++j) { - taskVector.value(i)->setExist(false); + taskVector.value(j)->setExist(false); } @@ -219,12 +221,17 @@ void ElementsTableModel::update() //qDebug() << "search in map :" << timer.elapsed() << "milliseconds"; //qDebug() << test.print("|"); - } task_list.close(); - //usleep(10000); + for (int i = 0; i < taskVector.size(); ++i) + { + if(!taskVector.value(i)->isExist()) + { + removeTask(taskVector.value(i)); + } + } } diff --git a/app/mainwindow.cpp b/app/mainwindow.cpp index 4addf8af3695996aa96068ffc52aa93aa724e99a..7b93e32cf3e9cf50761453c07419ce05b6e65d41 100644 --- a/app/mainwindow.cpp +++ b/app/mainwindow.cpp @@ -125,3 +125,13 @@ void MainWindow::on_comboBox_currentTextChanged(const QString &arg1) } + +void MainWindow::on_actionQuitter_triggered() +{ + +} + +void MainWindow::on_actionQuit_triggered() +{ + on_actionQuitter_triggered(); +} diff --git a/app/mainwindow.h b/app/mainwindow.h index 7adf44e5b302cee096e5324b3fff1b79cee689e7..1d1107d0d8136066ec7e06cf814a8edf825af6cb 100644 --- a/app/mainwindow.h +++ b/app/mainwindow.h @@ -39,6 +39,10 @@ private slots: void on_comboBox_currentTextChanged(const QString &arg1); + void on_actionQuitter_triggered(); + + void on_actionQuit_triggered(); + private: Ui::MainWindow *ui; int PIDselected;