🐞 fix(应用关闭): 修复关闭应用阻塞问题

卸载ftp之前不重置标志位防止读取当前进程阻塞
This commit is contained in:
huheng@kylinos.cn 2023-06-05 17:46:31 +08:00
parent dc9cbb2575
commit 99c45cf614
3 changed files with 68 additions and 65 deletions

View File

@ -65,6 +65,7 @@ void ConnectivityManager::startCommand(QString common)
void ConnectivityManager::killProcess(const char *cmd)
{
outLog(QString("start killProcess") + QString(cmd));
FILE *fp = popen(cmd, "r");
if (fp == NULL) {
outLog("command fail !");
@ -78,6 +79,8 @@ void ConnectivityManager::killProcess(const char *cmd)
QString item(buf);
memset(buf, '\0', sizeof(buf));
outLog(item);
if (item.isEmpty()) {
continue;
}

View File

@ -326,8 +326,8 @@ void MainWindow::deleterService()
m_activityDbusInterface = nullptr;
}
if (m_dbusInterface != nullptr) {
qInfo() << "kill all server!";
deInitDisc();
qInfo() << "kill all server!";
if (m_dbusInterface->isValid()) {
m_dbusInterface->call("killServerPortProcess");
m_dbusInterface->call("killConnectivity");
@ -748,6 +748,7 @@ void MainWindow::discInit()
void MainWindow::deInitDisc()
{
qInfo() << "deInitDisc!";
if (m_discovery != nullptr) {
m_discovery->stopDiscovery();
m_discovery->deleteLater();
@ -1103,7 +1104,6 @@ void MainWindow::slotDisconnect()
m_url.clear();
clearConnectionInfo();
m_isDbusOperation = false;
m_isMountFtp = false;
m_isPcSearchInfo = false;
m_searchLoadNum = 0;
m_reconnectAddress.clear();