Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-98099

Crash on exit with Application font and QFontComboBox

    XMLWordPrintable

Details

    • macOS, Windows
    • 9a131b59ee561e300fb6078886a85dd7b3c53599 (qt/qtbase/dev) 17119981db28378ec9c9d5465e5d46894fc02a86 (qt/tqtc-qtbase/5.15) cdc8b1bf2562a5706340559a12d4333e039584e5 (qt/qtbase/6.2)

    Description

      When adding an application font and showing a QFontComboBox, it will crash on exit.

      Looks like on ~QGuiApplication it cleans up the application fonts and then emits a signal to update all the QFontComboBox, but they're deleted or getting deleted at the same time and it causes a crash.

      Stack:

      1  QWidget::isActiveWindow() const                          qwidget.cpp                            6662 0x10016962d    
      2  QStyleOption::init(QWidget const *)                      qstyleoption.cpp                       197  0x1001aa07c    
      3  QStyleOption::initFrom(QWidget const *)                  qstyleoption.h                         107  0x100233c7d    
      4  QComboBox::initStyleOption(QStyleOptionComboBox *) const qcombobox.cpp                          1277 0x100233c72    
      5  QComboBoxPrivate::updateLineEditGeometry()               qcombobox.cpp                          1304 0x100233ef4    
      6  QComboBoxPrivate::setCurrentIndex(QModelIndex const&)    qcombobox.cpp                          2322 0x10023447a    
      7  QComboBox::setCurrentIndex(int)                          qcombobox.cpp                          2288 0x100233a38    
      8  QFontComboBoxPrivate::_q_updateModel()                   qfontcombobox.cpp                      365  0x1002668f5    
      9  void doActivate<false>(QObject *, int, void * *)         qobject.cpp                            3898 0x1010100d5    
      10 QFontDatabase::removeAllApplicationFonts()               qfontdatabase.cpp                      2623 0x10086682b    
      11 QGuiApplication::~QGuiApplication()                      qguiapplication.cpp                    698  0x10078e160    
      12 QApplication::~QApplication()                            qapplication.cpp                       771  0x1001343d0    
      13 main                                                     main.cpp                               16   0x100003902    
      14 start                                                    (x86_64) /usr/lib/system/libdyld.dylib      0x7fff203b7f3d 
      15 start                                                    (x86_64) /usr/lib/system/libdyld.dylib      0x7fff203b7f3d 
      

      I joined a repro app with a

      {ttf}

      file, but it doesn't look like it's needed to actually load the file in order to get the crash.

      Attachments

        Issue Links

          For Gerrit Dashboard: QTBUG-98099
          # Subject Branch Project Status CR V

          Activity

            People

              qt.team.quick.subscriptions Qt Quick and Widgets Team
              huelj Julien Huel
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes