equal
deleted
inserted
replaced
2610 QT_TRY { |
2610 QT_TRY { |
2611 cache = theFontCache(); |
2611 cache = theFontCache(); |
2612 } QT_CATCH (const std::bad_alloc &) { |
2612 } QT_CATCH (const std::bad_alloc &) { |
2613 // no cache - just ignore |
2613 // no cache - just ignore |
2614 } |
2614 } |
2615 if (cache && cache->hasLocalData()) { |
2615 if (cache && cache->hasLocalData()) |
2616 cache->localData()->clear(); |
|
2617 cache->setLocalData(0); |
2616 cache->setLocalData(0); |
2618 } |
|
2619 } |
2617 } |
2620 #endif // QT_NO_THREAD |
2618 #endif // QT_NO_THREAD |
2621 |
2619 |
2622 QFontCache::QFontCache() |
2620 QFontCache::QFontCache() |
2623 : QObject(), total_cost(0), max_cost(min_cost), |
2621 : QObject(), total_cost(0), max_cost(min_cost), |
2625 { |
2623 { |
2626 } |
2624 } |
2627 |
2625 |
2628 QFontCache::~QFontCache() |
2626 QFontCache::~QFontCache() |
2629 { |
2627 { |
|
2628 clear(); |
2630 { |
2629 { |
2631 EngineDataCache::ConstIterator it = engineDataCache.constBegin(), |
2630 EngineDataCache::ConstIterator it = engineDataCache.constBegin(), |
2632 end = engineDataCache.constEnd(); |
2631 end = engineDataCache.constEnd(); |
2633 while (it != end) { |
2632 while (it != end) { |
2634 if (it.value()->ref == 0) |
2633 if (it.value()->ref == 0) |