Fix memory leak in BitmapHeapTest

BUG=skia:

Review URL: https://codereview.chromium.org/715383003
This commit is contained in:
mtklein 2014-11-12 10:09:10 -08:00 committed by Commit bot
parent 88300a555f
commit 391e318b3d

View File

@ -17,9 +17,15 @@
struct SimpleFlatController : public SkFlatController {
SimpleFlatController() : SkFlatController() {}
virtual void* allocThrow(size_t bytes) SK_OVERRIDE { return sk_malloc_throw(bytes); }
virtual void unalloc(void* ptr) SK_OVERRIDE { sk_free(ptr); }
~SimpleFlatController() { fAllocations.freeAll(); }
virtual void* allocThrow(size_t bytes) SK_OVERRIDE {
fAllocations.push(sk_malloc_throw(bytes));
return fAllocations.top();
}
virtual void unalloc(void*) SK_OVERRIDE { }
void setBitmapStorage(SkBitmapHeap* h) { this->setBitmapHeap(h); }
private:
SkTDArray<void*> fAllocations;
};
struct SkShaderTraits {