diff options
author | Bartlomiej Moskal <bartlomiej.moskal@qt.io> | 2023-03-13 13:32:03 +0100 |
---|---|---|
committer | Samuel Mira <samuel.mira@qt.io> | 2023-03-16 12:59:09 +0000 |
commit | c60e8ef6801259cb481d8db0774c1a8bec579b43 (patch) | |
tree | 9bcc116d48883a14baa5d09d259bf23cf23f5897 /src | |
parent | ce891ca3e498cb3310318fdf752a66add7a8e050 (diff) | |
download | qtbase-c60e8ef6801259cb481d8db0774c1a8bec579b43.tar.gz |
androiddeployqt: remove infinity loop in deleteMissingFiles
There was a possibility of infinite loop and eventually crash when
androiddeployqt was used for the second time. Everything because of
deleteMissingFiles function for clean up previous build.
When we find the same names and those are directories, we call
recursively deleteMissingFiles. The parameters we use are absoluteDir,
not absoluteFilePath. As we use parent of found dir, deleteMissingFiles
is called with the same values as before.
This commit removes possibility of infinite loop by using
absoluteFilePath. That allows to avoid calling deleteMissingFiles with
the same parameters.
There is still a possibility, that directory that was found is not the
same as we were looking for. That will cause not needed files removing,
but those file will be copied again later.
This regression was created by 7dc05252a0df829bb5ea3994160d425bb0da26cb
commit
Fixes: QTBUG-111027
Change-Id: I195b4c407068b14e2ef94800ad1945adc66408cb
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit f4d897f04eee6386382096945f872ae9f306a5de)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit b0553d15a06c9a842e82caf8ce62530bd45d888c)
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/tools/androiddeployqt/main.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/tools/androiddeployqt/main.cpp b/src/tools/androiddeployqt/main.cpp index c47a9f3576..964daae99b 100644 --- a/src/tools/androiddeployqt/main.cpp +++ b/src/tools/androiddeployqt/main.cpp @@ -326,7 +326,7 @@ void deleteMissingFiles(const Options &options, const QDir &srcDir, const QDir & for (const QFileInfo &src : srcEntries) if (dst.fileName() == src.fileName()) { if (dst.isDir()) - deleteMissingFiles(options, src.absoluteDir(), dst.absoluteDir()); + deleteMissingFiles(options, src.absoluteFilePath(), dst.absoluteFilePath()); found = true; break; } @@ -1212,7 +1212,7 @@ void cleanTopFolders(const Options &options, const QDir &srcDir, const QString & const auto dirs = srcDir.entryInfoList(QDir::NoDotAndDotDot | QDir::Dirs); for (const QFileInfo &dir : dirs) { if (dir.fileName() != "libs"_L1) - deleteMissingFiles(options, dir.absoluteDir(), QDir(dstDir + dir.fileName())); + deleteMissingFiles(options, dir.absoluteFilePath(), QDir(dstDir + dir.fileName())); } } |