Clean up SkScaledImageCache at exit only in SK_DEVELOPER mode.

This is triggering ASAN failures in Chrome unit tests.

c.f. https://codereview.chromium.org/308003014

BUG=skia:
R=reed@google.com, mtklein@google.com

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/326913007
This commit is contained in:
mtklein 2014-06-10 11:13:47 -07:00 committed by Commit bot
parent 6de27127c4
commit 77ec7a6f44

View File

@ -670,7 +670,15 @@ void SkScaledImageCache::dump() const {
SK_DECLARE_STATIC_MUTEX(gMutex); SK_DECLARE_STATIC_MUTEX(gMutex);
static SkScaledImageCache* gScaledImageCache = NULL; static SkScaledImageCache* gScaledImageCache = NULL;
static void cleanup_gScaledImageCache() { SkDELETE(gScaledImageCache); } static void cleanup_gScaledImageCache() {
// We'll clean this up in our own tests, but disable for clients.
// Chrome seems to have funky multi-process things going on in unit tests that
// makes this unsafe to delete when the main process atexit()s.
// SkLazyPtr does the same sort of thing.
#if SK_DEVELOPER
SkDELETE(gScaledImageCache);
#endif
}
/** Must hold gMutex when calling. */ /** Must hold gMutex when calling. */
static SkScaledImageCache* get_cache() { static SkScaledImageCache* get_cache() {