diff options
author | Christian Lippka <cl@openoffice.org> | 2010-12-01 10:58:22 +0100 |
---|---|---|
committer | Christian Lippka <cl@openoffice.org> | 2010-12-01 10:58:22 +0100 |
commit | 9439eba6db26f27bb713168440d27fe51fbfadb8 (patch) | |
tree | e12be13a5610dada674d75b36822fe50047c1f95 /vcl/source/glyphs/glyphcache.cxx | |
parent | fa4b286294a272b085c2f74e12581edc2343fc18 (diff) | |
parent | 69777a477e6084a9cd49c92b25fa4dc35b41e49d (diff) |
impressdefaults1: merge
Diffstat (limited to 'vcl/source/glyphs/glyphcache.cxx')
-rw-r--r-- | vcl/source/glyphs/glyphcache.cxx | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/vcl/source/glyphs/glyphcache.cxx b/vcl/source/glyphs/glyphcache.cxx index 1953ecf553c4..7181db56dd4d 100644 --- a/vcl/source/glyphs/glyphcache.cxx +++ b/vcl/source/glyphs/glyphcache.cxx @@ -78,12 +78,18 @@ GlyphCache::~GlyphCache() void GlyphCache::InvalidateAllGlyphs() { -#if 0 // TODO: implement uncaching 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; -#endif + // 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') ) + { + // 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; + } } // ----------------------------------------------------------------------- |