diff options
author | Zhang Hao <zhanghao@uniontech.com> | 2021-11-10 17:29:21 +0800 |
---|---|---|
committer | Zhang Hao <zhanghao@uniontech.com> | 2021-11-16 17:21:56 +0800 |
commit | 9a131b59ee561e300fb6078886a85dd7b3c53599 (patch) | |
tree | 68e5a2950fc4c27cc9336b06814fb8e015879e81 /src/widgets | |
parent | 78a8e561b25d6a41e63d51bf49afb8622b278009 (diff) |
QFontComboBox don't response qApp fontDatabaseChanged()
If QFontComboBox is instantiated in the form of new and call
QFontDatabase::addApplicationFont, QFontComboBoxPrivate::_q_updateModel()
will be called when the program exits, at this time qApp will crash.
Fix this by when program exiting, QFontComboBoxPrivate don't need
call _q_updateModel().
Fixes: QTBUG-98099
Done-With: Konstantin Ritt <ritt.ks@gmail.com>
Pick-to: 5.15 6.2
Change-Id: I3df3d19c3d1971288d60f2eef386262befbf396b
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Diffstat (limited to 'src/widgets')
-rw-r--r-- | src/widgets/widgets/qfontcombobox.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/widgets/widgets/qfontcombobox.cpp b/src/widgets/widgets/qfontcombobox.cpp index 60a1f06764..a282f4ef3b 100644 --- a/src/widgets/widgets/qfontcombobox.cpp +++ b/src/widgets/widgets/qfontcombobox.cpp @@ -311,6 +311,10 @@ public: void QFontComboBoxPrivate::_q_updateModel() { Q_Q(QFontComboBox); + + if (QCoreApplication::closingDown()) + return; + const int scalableMask = (QFontComboBox::ScalableFonts | QFontComboBox::NonScalableFonts); const int spacingMask = (QFontComboBox::ProportionalFonts | QFontComboBox::MonospacedFonts); |