diff options
author | 2016-08-09 07:40:23 -0700 | |
---|---|---|
committer | 2016-08-09 07:40:23 -0700 | |
commit | 0c753e5c268ef88dee3cb5356f58b43a1e58fbf2 (patch) | |
tree | 5b3d4dc7a234bff739e4515165b8646bd89b9a41 /src/core/SkLiteDL.cpp | |
parent | 8369e32a05543c2619b1d7e740fe6ff6d2f03af3 (diff) |
Purge the SkLiteDL freelist when PurgeAllCaches() is called.
Seems like the polite thing to do.
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2228953002
Review-Url: https://codereview.chromium.org/2228953002
Diffstat (limited to 'src/core/SkLiteDL.cpp')
-rw-r--r-- | src/core/SkLiteDL.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/core/SkLiteDL.cpp b/src/core/SkLiteDL.cpp index 778f5c9563..329edb046b 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! + } +} |