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

Unified Diff: src/core/SkLiteDL.cpp

Issue 2228953002: Purge the SkLiteDL freelist when PurgeAllCaches() is called. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: stray static Created 4 years, 4 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 | « src/core/SkLiteDL.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkLiteDL.cpp
diff --git a/src/core/SkLiteDL.cpp b/src/core/SkLiteDL.cpp
index 778f5c9563c73adf1165166715ba9499aed26af9..329edb046b30b819cedf562e086dd51747cc6016 100644
--- a/src/core/SkLiteDL.cpp
+++ b/src/core/SkLiteDL.cpp
@@ -711,3 +711,12 @@ void SkLiteDL::internal_dispose() const {
delete this;
}
+
+void SkLiteDL::PurgeFreelist() {
+ SkAutoMutexAcquire lock(gFreeStackLock);
+ while (gFreeStack) {
+ SkLiteDL* top = gFreeStack;
+ gFreeStack = gFreeStack->fNext;
+ delete top; // Calling unref() here would just put it back on the list!
+ }
+}
« no previous file with comments | « src/core/SkLiteDL.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698