Bug 886518 - Purge the Skia typeface cache on shutdown in debug/valgrind builds r=jrmuizel

This commit is contained in:
Benoit Jacob 2013-06-28 22:48:35 -04:00
parent 3cc9485feb
commit 860e8df0b1
2 changed files with 14 additions and 1 deletions

View File

@ -144,6 +144,7 @@ EXPORTS.skia += [
'include/utils/SkDeferredCanvas.h',
'include/utils/SkRandom.h',
'include/views/SkTextBox.h',
'src/core/SkTypefaceCache.h',
]
if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa':

View File

@ -63,6 +63,10 @@
#include "TexturePoolOGL.h"
#endif
#ifdef USE_SKIA
#include "skia/SkGraphics.h"
#endif
#ifdef USE_SKIA_GPU
#include "skia/GrContext.h"
#include "skia/GrGLInterface.h"
@ -472,9 +476,17 @@ gfxPlatform::~gfxPlatform()
// cairo_debug_* function unconditionally.
//
// because cairo can assert and thus crash on shutdown, don't do this in release builds
#if MOZ_TREE_CAIRO && (defined(DEBUG) || defined(NS_BUILD_REFCNT_LOGGING) || defined(NS_TRACE_MALLOC))
#if defined(DEBUG) || defined(NS_BUILD_REFCNT_LOGGING) || defined(NS_TRACE_MALLOC) || defined(MOZ_VALGRIND)
#ifdef USE_SKIA
// must do Skia cleanup before Cairo cleanup, because Skia may be referencing
// Cairo objects e.g. through SkCairoFTTypeface
SkGraphics::Term();
#endif
#if MOZ_TREE_CAIRO
cairo_debug_reset_static_data();
#endif
#endif
#if 0
// It would be nice to do this (although it might need to be after