Fix a memory leak in SkBitmapHeap.

When I switched fLookupTable to be an array of pointers, I did not
delete those pointers when I was done with them. Do it now.

Also modify SkTDArray::deleteAll to call SkDELETE instead of delete.

Review URL: https://codereview.appspot.com/6453129

git-svn-id: http://skia.googlecode.com/svn/trunk@5137 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
scroggo 2012-08-16 20:30:18 +00:00
Родитель 1d4edd38f6
Коммит c51db02181
2 изменённых файлов: 2 добавлений и 1 удалений

Просмотреть файл

@ -266,7 +266,7 @@ public:
T* iter = fArray;
T* stop = fArray + fCount;
while (iter < stop) {
delete (*iter);
SkDELETE (*iter);
iter += 1;
}
this->reset();

Просмотреть файл

@ -104,6 +104,7 @@ SkBitmapHeap::~SkBitmapHeap() {
SkASSERT(0 == fBytesAllocated);
fStorage.deleteAll();
SkSafeUnref(fExternalStorage);
fLookupTable.deleteAll();
}
SkTRefArray<SkBitmap>* SkBitmapHeap::extractBitmaps() const {