From 666ecc4d01324dbdaaafac7b50088a65572c5dfb Mon Sep 17 00:00:00 2001 From: "S. Razi Alavizadeh" Date: Fri, 30 May 2014 07:58:51 +0430 Subject: [PATCH] [LocationCompleter] Don't leak when query icons, - it seems it's a fix for #1299 --- src/lib/navigation/completer/locationcompleterrefreshjob.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/navigation/completer/locationcompleterrefreshjob.cpp b/src/lib/navigation/completer/locationcompleterrefreshjob.cpp index de5200307..b69c8ec9d 100644 --- a/src/lib/navigation/completer/locationcompleterrefreshjob.cpp +++ b/src/lib/navigation/completer/locationcompleterrefreshjob.cpp @@ -95,11 +95,11 @@ void LocationCompleterRefreshJob::runJob() } // Load all icons into QImage + QSqlQuery query; + query.prepare(QSL("SELECT icon FROM icons WHERE url LIKE ? LIMIT 1")); foreach (QStandardItem* item, m_items) { const QUrl url = item->data(LocationCompleterModel::UrlRole).toUrl(); - QSqlQuery query; - query.prepare(QSL("SELECT icon FROM icons WHERE url LIKE ? LIMIT 1")); query.addBindValue(QString(QL1S("%1%")).arg(QString::fromUtf8(url.toEncoded(QUrl::RemoveFragment)))); QSqlQuery res = SqlDatabase::instance()->exec(query);