From 933f32ee67581f3cee7c9d5a57319067e10ae92f Mon Sep 17 00:00:00 2001 From: zhangjiaping Date: Wed, 13 Jan 2021 18:33:05 +0800 Subject: [PATCH] fix(thread): Process stuck because of thread. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Description: 修复线程无法终止导致的卡死问题 Log: 重新添加参数 --- src/mainwindow.cpp | 12 +++++++----- src/search-result.cpp | 2 +- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 9fa7359..f4f3014 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -218,11 +218,13 @@ void MainWindow::initUi() */ void MainWindow::bootOptionsFilter(QString opt) { - clearSearchResult(); - this->show(); - this->raise(); - this->activateWindow(); -// m_search_result_thread->start(); + if (opt == "-s" || opt == "--show") { + clearSearchResult(); + this->show(); + this->raise(); + this->activateWindow(); +// m_search_result_thread->start(); + } } /** diff --git a/src/search-result.cpp b/src/search-result.cpp index 13f6170..36431c4 100644 --- a/src/search-result.cpp +++ b/src/search-result.cpp @@ -43,7 +43,7 @@ void SearchResult::run() m_mainwindow->m_searcher->m_mutex2.unlock(); } m_mainwindow->m_searcher->m_mutex3.lock(); - if (!m_mainwindow->m_search_result_content->isEmpty()) +// if (!m_mainwindow->m_search_result_content->isEmpty()) // qDebug() << m_mainwindow->m_search_result_content->head(); if (!m_mainwindow->m_search_result_content->isEmpty()) { Q_EMIT this->searchResultContent(m_mainwindow->m_search_result_content->dequeue());