From 69dabcae32b952d2d5092f038257854a232e54a4 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Fri, 31 May 2019 12:38:34 +0200 Subject: [PATCH] [libcalamares] Avoid static destructor - The static destructor issues a warning on exit: QBasicTimer::start: QBasicTimer can only be used with threads started with QThread so instead, heap-allocate the model. This leaks memory, but it's a singleton *and* we're exiting anyway. --- src/libcalamares/locale/LabelModel.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libcalamares/locale/LabelModel.cpp b/src/libcalamares/locale/LabelModel.cpp index ef8ff8ea1..79ff5d67b 100644 --- a/src/libcalamares/locale/LabelModel.cpp +++ b/src/libcalamares/locale/LabelModel.cpp @@ -125,8 +125,8 @@ LabelModel::find( const QString& countryCode ) const LabelModel* availableTranslations() { - static LabelModel model( QString( CALAMARES_TRANSLATION_LANGUAGES ).split( ';') ); - return &model; + static LabelModel* model = new LabelModel( QString( CALAMARES_TRANSLATION_LANGUAGES ).split( ';') ); + return model; } }