修复两处内存问题

This commit is contained in:
iaom 2022-12-29 14:27:46 +08:00
parent 29c6440e23
commit c3fadf77c2
2 changed files with 4 additions and 3 deletions

View File

@ -73,7 +73,7 @@ void ReceiveResultThread::stop()
void ReceiveResultThread::run()
{
QTimer * m_timer = new QTimer;
QTimer *m_timer = new QTimer;
m_timer->setInterval(3000);
bool is_empty;
while(!isInterruptionRequested()) {
@ -86,7 +86,6 @@ void ReceiveResultThread::run()
}
if(m_timer->isActive() && m_timer->remainingTime() < 0.01) {
this->requestInterruption();
qWarning()<<"-------------->stopped by itself";
}
if(is_empty && !m_timer->isActive()) {
m_timer->start();
@ -96,4 +95,5 @@ void ReceiveResultThread::run()
msleep(100);
}
}
delete m_timer;
}

View File

@ -40,11 +40,12 @@ void UkuiSearch::WebSearchPlugin::KeywordSearch(QString keyword, DataQueue<UkuiS
QString defaultwebengines(getDefaultAppId(BROWSERTYPE));
QByteArray ba = QString(DESKTOPPATH + defaultwebengines).toUtf8();
GDesktopAppInfo * textinfo = g_desktop_app_info_new_from_filename(ba.constData());
const char * iconname = g_icon_to_string(g_app_info_get_icon(G_APP_INFO(textinfo)));
char *iconname = g_icon_to_string(g_app_info_get_icon(G_APP_INFO(textinfo)));
QIcon appicon;
appicon = QIcon::fromTheme(QString(QLatin1String(iconname)),
QIcon(QString("/usr/share/pixmaps/"+QString(QLatin1String(iconname))
+".png")));
g_free(iconname);
resultInfo.icon = QIcon(appicon);
resultInfo.actionKey = m_keyWord;