diff --git a/modules/wrappers/wrapper_stdio/dlgwrpstdio.cpp b/modules/wrappers/wrapper_stdio/dlgwrpstdio.cpp index 7ded4d346fad86f694905ef5c69fb949eb01989b..a0ac23e034306231c2fbe6a239f28c71fc9202bd 100644 --- a/modules/wrappers/wrapper_stdio/dlgwrpstdio.cpp +++ b/modules/wrappers/wrapper_stdio/dlgwrpstdio.cpp @@ -69,7 +69,7 @@ void DlgWrpStdio::run() { m_plistenThd = new listen_thread(this); connect(m_plistenThd,&listen_thread::quit_app, - this,&DlgWrpStdio::close); + this,&DlgWrpStdio::slot_quit,Qt::QueuedConnection); connect(m_plistenThd,&listen_thread::new_package, this,&DlgWrpStdio::slot_newPackage ); @@ -314,3 +314,15 @@ void DlgWrpStdio::saveIni() QString plainTextEdit_extraEnv = ui->plainTextEdit_extraEnv->toPlainText(); settings.setValue("settings/plainTextEdit_extraEnv",plainTextEdit_extraEnv); } + +void DlgWrpStdio::slot_quit() +{ + if (m_process) + { + m_process->terminate(); + m_process->waitForFinished(1000); + m_process->kill(); + m_process->waitForFinished(1000); + } + close(); +} diff --git a/modules/wrappers/wrapper_stdio/dlgwrpstdio.h b/modules/wrappers/wrapper_stdio/dlgwrpstdio.h index 165a027c41ac039a59f62e0bc605f545ac98c36b..738df7d41e4596734bec45c271e95652813dd851 100644 --- a/modules/wrappers/wrapper_stdio/dlgwrpstdio.h +++ b/modules/wrappers/wrapper_stdio/dlgwrpstdio.h @@ -31,8 +31,9 @@ private slots: void slot_readyReadStandardOutput(); void slot_readyReadStandardError(); void slot_sended(qint64 ); - void slot_started( ); + void slot_started(); void slot_stopped(); + void slot_quit(); void on_pushButton_start_clicked(); void on_toolButton_path_clicked(); void on_toolButton_workingDir_clicked();