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
#include "SkGeometry.h"
#include "SkGlyphCache.h"
#include "SkImageFilter.h"
+#include "SkLiteDL.h"
#include "SkMath.h"
#include "SkMatrix.h"
#include "SkOpts.h"
SkGraphics::PurgeFontCache();
SkGraphics::PurgeResourceCache();
SkImageFilter::PurgeCache();
+ SkLiteDL::PurgeFreelist();
}
///////////////////////////////////////////////////////////////////////////////
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!
+ }
+}
public:
static sk_sp<SkLiteDL> New(SkRect);
+ static void PurgeFreelist();
+
void optimizeFor(GrContext*);
void makeThreadsafe();