From 8f1cd66a7d4174cf91f432d236a878ce64767a89 Mon Sep 17 00:00:00 2001 From: jules Date: Tue, 4 Dec 2007 14:59:17 +0000 Subject: [PATCH] --- .../platform_specific_code/juce_mac_Fonts.cpp | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/build/macosx/platform_specific_code/juce_mac_Fonts.cpp b/build/macosx/platform_specific_code/juce_mac_Fonts.cpp index 298b6763cd..22e8da2ea5 100644 --- a/build/macosx/platform_specific_code/juce_mac_Fonts.cpp +++ b/build/macosx/platform_specific_code/juce_mac_Fonts.cpp @@ -319,7 +319,7 @@ public: { for (int i = cache.size(); --i >= 0;) { - ATSFontHelper* const f = (ATSFontHelper*) cache[i]; + ATSFontHelper* const f = (ATSFontHelper*) cache.getUnchecked(i); delete f; } @@ -354,7 +354,7 @@ public: { for (int i = cache.size(); --i >= 0;) { - ATSFontHelper* const f2 = (ATSFontHelper*) cache[i]; + ATSFontHelper* const f2 = (ATSFontHelper*) cache.getUnchecked(i); if (f == f2) { @@ -370,18 +370,21 @@ public: void timerCallback() { + stopTimer(); + for (int i = cache.size(); --i >= 0;) { - ATSFontHelper* const f = (ATSFontHelper*) cache[i]; + ATSFontHelper* const f = (ATSFontHelper*) cache.getUnchecked(i); - if (f->refCount > 0) + if (f->refCount == 0) { - stopTimer(); - return; + cache.remove (i); + delete f; } } - delete this; + if (cache.size() == 0) + delete this; } juce_DeclareSingleton_SingleThreaded_Minimal (ATSFontHelperCache)