[Tests] Keep the icon render test QApplication alive until exit

Creating it as a function-local static tears it down before Qt's library statics
at exit, and libQt6Network then runs QObject destructors against freed memory —
a SEGV the sanitizer leg reports after the tests have already passed. Leak the
application instead, the usual pattern for a test binary.
This commit is contained in:
Lukas Brübach 2026-10-23 09:58:35 +02:00
parent 95537a8ea8
commit c47ea6e8d4

View file

@ -28,7 +28,10 @@ void ensureGuiApplication()
static int argc = 1;
static char name[] = "theme_icon_test";
static char *argv[] = {name, nullptr};
static QApplication app(argc, argv);
// Leaked on purpose: a function-local static QApplication is destroyed before Qt's
// own library statics at exit, and the network module's destructors then run
// against a torn-down QObject layer (SEGV under AddressSanitizer).
static QApplication *app = new QApplication(argc, argv);
Q_UNUSED(app);
}