diff options
author | mtklein <mtklein@chromium.org> | 2014-06-10 11:13:47 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-06-10 11:13:47 -0700 |
commit | 77ec7a6f44ccfdacc9c3422516f09720ca17f9e2 (patch) | |
tree | e9dd82299cb507126be90fd328362dfe33a63567 /src/core/SkScaledImageCache.cpp | |
parent | 6de27127c4d50ef90b5435aefaeef47fa84b819d (diff) |
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
Diffstat (limited to 'src/core/SkScaledImageCache.cpp')
-rw-r--r-- | src/core/SkScaledImageCache.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/core/SkScaledImageCache.cpp b/src/core/SkScaledImageCache.cpp index b69b949b39..f266f97171 100644 --- a/src/core/SkScaledImageCache.cpp +++ b/src/core/SkScaledImageCache.cpp @@ -670,7 +670,15 @@ void SkScaledImageCache::dump() const { SK_DECLARE_STATIC_MUTEX(gMutex); 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. */ static SkScaledImageCache* get_cache() { |