зеркало из https://github.com/mozilla/moz-skia.git
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:
Родитель
1d4edd38f6
Коммит
c51db02181
|
@ -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 {
|
||||
|
|
Загрузка…
Ссылка в новой задаче