Skip to content
Snippets Groups Projects
Commit 44bc8ed6 authored by Olivier Langella's avatar Olivier Langella
Browse files

terminate worker thread correctly

parent ca927b2e
No related branches found
No related tags found
No related merge requests found
......@@ -43,8 +43,8 @@ MainWindow::MainWindow(QWidget *parent):
setWindowTitle(QString("%1 %2").arg(SOFTWARE_NAME).arg(XTPCPP_VERSION));
WorkerThread *worker = new WorkerThread(this);
worker->moveToThread(&workerThread);
workerThread.start();
worker->moveToThread(&_worker_thread);
_worker_thread.start();
_p_load_results_dialog = new LoadResultsDialog(this);
_p_export_spreadsheet_dialog = new ExportSpreadsheetDialog(this);
......@@ -88,8 +88,8 @@ MainWindow::MainWindow(QWidget *parent):
MainWindow::~MainWindow()
{
workerThread.quit();
workerThread.wait();
_worker_thread.quit();
_worker_thread.wait();
//if (_p_ms_data_file != nullptr) delete _p_ms_data_file;
delete ui;
delete _project_window;
......
......@@ -47,7 +47,6 @@ class Main;
class MainWindow: public QMainWindow {
Q_OBJECT
QThread workerThread;
public:
......@@ -96,6 +95,7 @@ private:
private :
Ui::Main *ui;
QThread _worker_thread;
ProjectSp _project_sp=nullptr;
ProjectWindow * _project_window=nullptr;
......
......@@ -45,8 +45,8 @@ ProjectWindow::ProjectWindow(MainWindow *parent):
ui->setupUi(this);
WorkerThread * p_worker = new WorkerThread(this);
p_worker->moveToThread(&worker_thread);
worker_thread.start();
p_worker->moveToThread(&_worker_thread);
_worker_thread.start();
_p_fasta_str_li = new QStandardItemModel();
ui->decoy_database_listview->setModel(_p_fasta_str_li);
......@@ -87,6 +87,8 @@ ProjectWindow::ProjectWindow(MainWindow *parent):
ProjectWindow::~ProjectWindow()
{
//if (_p_ms_data_file != nullptr) delete _p_ms_data_file;
_worker_thread.quit();
_worker_thread.wait();
delete ui;
}
......
......@@ -46,7 +46,6 @@ class ProjectView;
class ProjectWindow: public QMainWindow {
Q_OBJECT
QThread worker_thread;
friend class ProteinListWindow;
friend class PeptideListWindow;
......@@ -99,6 +98,7 @@ private :
private:
QThread _worker_thread;
Ui::ProjectView *ui;
QWidget * _p_identification_widget = nullptr;
AutomaticFilterWidget * _p_automatic_filter_widget = nullptr;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment