aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBogDan Vatra <bogdan@kde.org>2019-10-15 18:08:37 +0300
committerEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>2019-10-16 09:31:33 +0000
commite1eb99dfc0896f81dbcb8d5eed7bb8c18839dac6 (patch)
treee5dd28d9083892ff2c1d18aa0eca1e5e3086901c /src
parentd1047887a6fd4f890484203a01ee5f1eefc1a20a (diff)
Android: Fix crash in release mode
When using the "auto" keyword, we would keep a reference to the QStringBuilder, instead of converting it to a QString. This object would in turn keep references to the pluginName string, which the compiler would delete, and we would get a crash later on, when the actual conversion took place. So this is a sneaky compiler bug and the work-around is to explicitly convert the QStringBuilder to a QString right away. Fixes: QTBUG-79230 Change-Id: I0759645c84d6f995f26063ea098cdaea61e924ab Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> Reviewed-by: BogDan Vatra <bogdan@kdab.com>
Diffstat (limited to 'src')
-rw-r--r--src/qml/qml/qqmlimport.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/qml/qml/qqmlimport.cpp b/src/qml/qml/qqmlimport.cpp
index 8b5e11c890..3bf8d807a9 100644
--- a/src/qml/qml/qqmlimport.cpp
+++ b/src/qml/qml/qqmlimport.cpp
@@ -1812,7 +1812,8 @@ QString QQmlImportDatabase::resolvePlugin(QQmlTypeLoader *typeLoader,
if (qmldirPath.size() > 25 && qmldirPath.at(0) == QLatin1Char(':') && qmldirPath.at(1) == QLatin1Char('/') &&
qmldirPath.startsWith(QStringLiteral(":/android_rcc_bundle/qml/"), Qt::CaseInsensitive)) {
QString pluginName = qmldirPath.mid(21) + Slash + baseName;
- auto bundledPath = resolvedPath + QLatin1String("lib") + pluginName.replace(QLatin1Char('/'), QLatin1Char('_'));
+ pluginName.replace(QLatin1Char('/'), QLatin1Char('_'));
+ QString bundledPath = resolvedPath + QLatin1String("lib") + pluginName;
for (const QString &suffix : suffixes) {
const QString absolutePath = typeLoader->absoluteFilePath(bundledPath + suffix);
if (!absolutePath.isEmpty())