diff options
-rw-r--r-- | src/corelib/i18n/mlocationdatabase.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/corelib/i18n/mlocationdatabase.cpp b/src/corelib/i18n/mlocationdatabase.cpp index e2b2aa54..6b98f271 100644 --- a/src/corelib/i18n/mlocationdatabase.cpp +++ b/src/corelib/i18n/mlocationdatabase.cpp @@ -256,14 +256,15 @@ QList<MCity> MLocationDatabase::matchingCities(const QString& searchString) Q_D(MLocationDatabase); QList<MCity> list; - QStringMatcher matcher(searchString, Qt::CaseInsensitive); + QStringMatcher *matcher = new QStringMatcher(searchString, Qt::CaseInsensitive); foreach (const MCity &city, d->cities) { - if (matcher.indexIn(city.englishName()) != -1 - || matcher.indexIn(city.localName()) != -1) + if (matcher->indexIn(city.englishName()) != -1 + || matcher->indexIn(city.localName()) != -1) { list.append( city ); } } + delete matcher; return list; } |