Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(144)

Unified Diff: tools/sk_tool_utils_font.cpp

Issue 1180593005: call portable font cleanup only once at app end (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/sk_tool_utils.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/sk_tool_utils_font.cpp
diff --git a/tools/sk_tool_utils_font.cpp b/tools/sk_tool_utils_font.cpp
index 5cb65b205c2d6dce1171cde8267721c234de1c0b..925bd7dc76ad8caa62614583284a740dd4587598 100644
--- a/tools/sk_tool_utils_font.cpp
+++ b/tools/sk_tool_utils_font.cpp
@@ -20,17 +20,11 @@ namespace sk_tool_utils {
#include "test_font_serif.cpp"
#include "test_font_index.cpp"
-static void release_portable_typefaces() {
- // 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
+void release_portable_typefaces() {
for (int index = 0; index < gTestFontsCount; ++index) {
SkTestFontData& fontData = gTestFonts[index];
SkSafeUnref(fontData.fFontCache);
}
-#endif
}
SK_DECLARE_STATIC_MUTEX(gTestFontMutex);
@@ -69,7 +63,6 @@ SkTypeface* create_font(const char* name, SkTypeface::Style style) {
SkDEBUGCODE(font->fDebugName = sub->fName);
SkDEBUGCODE(font->fDebugStyle = sub->fStyle);
fontData->fFontCache = SkSafeRef(font);
- atexit(release_portable_typefaces);
mtklein 2015/06/15 13:57:36 Ah, we called this for each portable typeface, but
}
}
return SkNEW_ARGS(SkTestTypeface, (font, SkFontStyle(style)));
« no previous file with comments | « tools/sk_tool_utils.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698