diff options
author | Friedemann Kleint <[email protected]> | 2025-07-07 21:46:38 +0200 |
---|---|---|
committer | Friedemann Kleint <[email protected]> | 2025-07-08 14:52:20 +0200 |
commit | 3ad72714076ac04057e1cd78d16383894762cca0 (patch) | |
tree | 3c29427b11b3b8245d2df3e6e74b3bf985585b6f | |
parent | af9721d92e393529016f8eccf4a23cc95da8b021 (diff) |
Use a QScopeGuard to make sure it is written also in case of
ApiExtractor failing.
Task-number: PYSIDE-3105
Pick-to: 6.9
Change-Id: I25fbca24633f1468c674422919405bdb11fc2811
Reviewed-by: Shyamnath Premnadh <[email protected]>
-rw-r--r-- | sources/shiboken6/generator/main.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/sources/shiboken6/generator/main.cpp b/sources/shiboken6/generator/main.cpp index 0c30edbef..38b8d7b22 100644 --- a/sources/shiboken6/generator/main.cpp +++ b/sources/shiboken6/generator/main.cpp @@ -19,6 +19,7 @@ #include <QtCore/qdir.h> #include <QtCore/qfile.h> #include <QtCore/qlibrary.h> +#include <QtCore/qscopeguard.h> #include <QtCore/qvariant.h> #include "qtcompat.h" @@ -373,6 +374,11 @@ int shibokenMain(const QStringList &argV) return EXIT_FAILURE; } + auto logWriterFunc = [&commonOptions]() { + ReportHandler::writeGeneralLogFile(commonOptions.outputDirectory); + }; + auto logWriter = qScopeGuard(logWriterFunc); + extractor.setCppFileNames(cppFileNames); extractor.setTypeSystem(commonOptions.typeSystemFileName); @@ -416,8 +422,6 @@ int shibokenMain(const QStringList &argV) if (commonOptions.logUnmatched) TypeDatabase::instance()->logUnmatched(); - ReportHandler::writeGeneralLogFile(commonOptions.outputDirectory); - const QByteArray doneMessage = ReportHandler::doneMessage(); std::cout << doneMessage.constData() << '\n'; |