diff options
author | Caolán McNamara <caolanm@redhat.com> | 2012-09-03 16:13:23 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2012-09-03 17:01:38 +0100 |
commit | 402603793360fb058f84e2aa88d5fdcd6131334d (patch) | |
tree | 3881529498246ce58cf310682496e28b200cccce /vcl | |
parent | 92efdaf94bc9aa463ed7c73526fbb55ec51e9ff5 (diff) |
make GlyphCache::InvalidateAllGlyphs do what it says it does
all the things we say don't do in GlyphCache::InvalidateAllGlyphs but would do
if the random debugging getenv was set are always done in the lines after
the one and only call to this.
Change-Id: Icd5719f12ab687568c95d59b1f6413a13cef3e3a
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/generic/glyphs/glyphcache.cxx | 26 |
1 files changed, 8 insertions, 18 deletions
diff --git a/vcl/generic/glyphs/glyphcache.cxx b/vcl/generic/glyphs/glyphcache.cxx index bf2159ede80d..923ca476895f 100644 --- a/vcl/generic/glyphs/glyphcache.cxx +++ b/vcl/generic/glyphs/glyphcache.cxx @@ -68,32 +68,22 @@ GlyphCache::GlyphCache( GlyphCachePeer& rPeer ) GlyphCache::~GlyphCache() { InvalidateAllGlyphs(); - for( FontList::iterator it = maFontList.begin(), end = maFontList.end(); it != end; ++it ) - { - ServerFont* pServerFont = it->second; - mrPeer.RemovingFont(*pServerFont); - delete pServerFont; - } - if( mpFtManager ) - delete mpFtManager; + delete mpFtManager; } // ----------------------------------------------------------------------- void GlyphCache::InvalidateAllGlyphs() { - // an application about to exit can omit garbage collecting the heap - // since it makes things slower and introduces risks if the heap was not perfect - // for debugging, for memory grinding or leak checking the env allows to force GC - const char* pEnv = getenv( "SAL_FORCE_GC_ON_EXIT" ); - if( pEnv && (*pEnv != '0') ) + for( FontList::iterator it = maFontList.begin(), end = maFontList.end(); it != end; ++it ) { - // uncache of all glyph shapes and metrics - for( FontList::iterator it = maFontList.begin(); it != maFontList.end(); ++it ) - delete const_cast<ServerFont*>( it->second ); - maFontList.clear(); - mpCurrentGCFont = NULL; + ServerFont* pServerFont = it->second; + mrPeer.RemovingFont(*pServerFont); + delete pServerFont; } + + maFontList.clear(); + mpCurrentGCFont = NULL; } // ----------------------------------------------------------------------- |