QFontDatabase: Use more explicit function name for clearing families
Avoids overloading on ::free() from stdlib.h Change-Id: I71d7fa4012f189cf5640968ed43d530eff79989f Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
This commit is contained in:
parent
4bd3080163
commit
3b6aba6598
@ -298,12 +298,22 @@ void QtFontFamily::ensurePopulated()
|
||||
Q_ASSERT_X(populated, Q_FUNC_INFO, qPrintable(name));
|
||||
}
|
||||
|
||||
void QFontDatabasePrivate::clearFamilies()
|
||||
{
|
||||
while (count--)
|
||||
delete families[count];
|
||||
::free(families);
|
||||
families = nullptr;
|
||||
count = 0;
|
||||
// don't clear the memory fonts!
|
||||
}
|
||||
|
||||
void QFontDatabasePrivate::invalidate()
|
||||
{
|
||||
QFontCache::instance()->clear();
|
||||
|
||||
fallbacksCache.clear();
|
||||
free();
|
||||
clearFamilies();
|
||||
QGuiApplicationPrivate::platformIntegration()->fontDatabase()->invalidate();
|
||||
emit static_cast<QGuiApplication *>(QCoreApplication::instance())->fontDatabaseChanged();
|
||||
}
|
||||
@ -530,7 +540,7 @@ void qt_cleanupFontDatabase()
|
||||
{
|
||||
auto *db = QFontDatabasePrivate::instance();
|
||||
db->fallbacksCache.clear();
|
||||
db->free();
|
||||
db->clearFamilies();
|
||||
}
|
||||
|
||||
// used in qfont.cpp
|
||||
|
@ -221,9 +221,11 @@ public:
|
||||
{ }
|
||||
|
||||
~QFontDatabasePrivate() {
|
||||
free();
|
||||
clearFamilies();
|
||||
}
|
||||
|
||||
void clearFamilies();
|
||||
|
||||
enum FamilyRequestFlags {
|
||||
RequestFamily = 0,
|
||||
EnsureCreated,
|
||||
@ -231,14 +233,6 @@ public:
|
||||
};
|
||||
|
||||
QtFontFamily *family(const QString &f, FamilyRequestFlags flags = EnsurePopulated);
|
||||
void free() {
|
||||
while (count--)
|
||||
delete families[count];
|
||||
::free(families);
|
||||
families = nullptr;
|
||||
count = 0;
|
||||
// don't clear the memory fonts!
|
||||
}
|
||||
|
||||
int count;
|
||||
QtFontFamily **families;
|
||||
|
Loading…
Reference in New Issue
Block a user