Close a couple of minor memory leaks, add a valgrind suppression file to
mute complaints about apparent driver bugs.
http://codereview.appspot.com/5837046/
git-svn-id: http://skia.googlecode.com/svn/trunk@3406 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/tests/BitmapCopyTest.cpp b/tests/BitmapCopyTest.cpp
index d5fd7df..27a145e 100644
--- a/tests/BitmapCopyTest.cpp
+++ b/tests/BitmapCopyTest.cpp
@@ -474,7 +474,8 @@
// raw buffer pointer.
const uint32_t bufSize = subH *
SkBitmap::ComputeRowBytes(src.getConfig(), subW) * 2;
- uint8_t* buf = new uint8_t[bufSize];
+ SkAutoMalloc autoBuf (bufSize);
+ uint8_t* buf = static_cast<uint8_t*>(autoBuf.get());
SkBitmap bufBm; // Attach buf to this bitmap.
bool successExpected;
@@ -593,7 +594,6 @@
subset.copyPixelsFrom(buf, 1, subset.rowBytes()) ==
false);
- delete [] buf;
#endif
}
}