QWindowsFontDataBase: use QSharedPointer::create()
More efficient, because control block and tracked object are co-located in a single memory allocation. Change-Id: Ibd1a37836b96837afd6209a743a05a727dbc9907 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
This commit is contained in:
parent
32eeb46f3c
commit
9cbee30661
@ -1041,7 +1041,7 @@ QSharedPointer<QWindowsFontEngineData> sharedFontData()
|
||||
{
|
||||
FontEngineThreadLocalData *data = fontEngineThreadLocalData();
|
||||
if (!data->hasLocalData())
|
||||
data->setLocalData(QSharedPointer<QWindowsFontEngineData>(new QWindowsFontEngineData));
|
||||
data->setLocalData(QSharedPointer<QWindowsFontEngineData>::create());
|
||||
return data->localData();
|
||||
}
|
||||
#else // !QT_NO_THREAD
|
||||
@ -1051,7 +1051,7 @@ QWindowsFontEngineDataPtr sharedFontData()
|
||||
{
|
||||
QWindowsFontEngineDataPtr *data = fontEngineData();
|
||||
if (data->isNull())
|
||||
*data = QWindowsFontEngineDataPtr(new QWindowsFontEngineData);
|
||||
*data = QWindowsFontEngineDataPtr::create();
|
||||
return *data;
|
||||
}
|
||||
#endif // QT_NO_THREAD
|
||||
|
Loading…
Reference in New Issue
Block a user