mirror of
https://gitee.com/spark-store-project/spark-store
synced 2025-10-21 09:42:20 +08:00
fix: high CPU usage because futex is still waiting for queue after illegal exit
This commit is contained in:
parent
19dff7fb56
commit
c65d7b86df
@ -18,6 +18,7 @@
|
|||||||
#include <QSettings>
|
#include <QSettings>
|
||||||
#include <QGraphicsOpacityEffect>
|
#include <QGraphicsOpacityEffect>
|
||||||
#include <QtConcurrent> // 并发
|
#include <QtConcurrent> // 并发
|
||||||
|
#include <QCloseEvent> // close event
|
||||||
|
|
||||||
#include <DApplication>
|
#include <DApplication>
|
||||||
#include <DGuiApplicationHelper>
|
#include <DGuiApplicationHelper>
|
||||||
@ -687,10 +688,6 @@ void Widget::searchApp(QString text)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// sendNotification(tr("Spark store could only process spk:// links for now. The search feature is coming soon!"));
|
|
||||||
// ui->webView->setUrl(QUrl("http://www.baidu.com/s?wd="+text)); // 这东西对接百度
|
|
||||||
// ui->stackedWidget->setCurrentIndex(0);
|
|
||||||
|
|
||||||
// 禁止同时进行多次搜索
|
// 禁止同时进行多次搜索
|
||||||
if (!mutex.tryLock())
|
if (!mutex.tryLock())
|
||||||
{
|
{
|
||||||
@ -711,18 +708,23 @@ void Widget::searchApp(QString text)
|
|||||||
mutex.unlock();
|
mutex.unlock();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
displaySearchApp(json);
|
displaySearchApp(json); })
|
||||||
})
|
|
||||||
.onError([this](QString errorStr)
|
.onError([this](QString errorStr)
|
||||||
{
|
{
|
||||||
qDebug() << "请求出错:" << errorStr;
|
qDebug() << "请求出错:" << errorStr;
|
||||||
sendNotification(QString(tr("Request Error: %1")).arg(errorStr));
|
sendNotification(QString(tr("Request Error: %1")).arg(errorStr));
|
||||||
mutex.unlock();
|
mutex.unlock();
|
||||||
return;
|
return; })
|
||||||
})
|
|
||||||
.timeout(10 * 1000)
|
.timeout(10 * 1000)
|
||||||
.exec();
|
.exec();
|
||||||
}
|
}
|
||||||
|
httpClient->deleteLater();
|
||||||
|
}
|
||||||
|
|
||||||
|
void Widget::closeEvent(QCloseEvent *event)
|
||||||
|
{
|
||||||
|
mutex.unlock();
|
||||||
|
httpClient->deleteLater();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -128,6 +128,7 @@ private:
|
|||||||
void setfoot(int);
|
void setfoot(int);
|
||||||
void updatefoot();
|
void updatefoot();
|
||||||
void updateUI();
|
void updateUI();
|
||||||
|
void closeEvent(QCloseEvent *event);
|
||||||
|
|
||||||
quint64 dirFileSize(const QString &path);
|
quint64 dirFileSize(const QString &path);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user