Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(650)

Unified Diff: src/utils/debugger/SkObjectParser.cpp

Issue 23068033: remove mismatched delete (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/utils/debugger/SkObjectParser.cpp
diff --git a/src/utils/debugger/SkObjectParser.cpp b/src/utils/debugger/SkObjectParser.cpp
index 504cd085c92fc38ad8924c24370ed4dd6879df95..85ac4d3839145343a6eb528b7a78406f86de613a 100644
--- a/src/utils/debugger/SkObjectParser.cpp
+++ b/src/utils/debugger/SkObjectParser.cpp
@@ -336,10 +336,10 @@ SkString* SkObjectParser::TextToString(const void* text, size_t byteLength,
case SkPaint::kUTF16_TextEncoding: {
decodedText->append("UTF-16: ");
size_t sizeNeeded = SkUTF16_ToUTF8((uint16_t*)text, byteLength / 2, NULL);
- char* utf8 = new char[sizeNeeded];
+ SkAutoTArray<char> autoArray(sizeNeeded);
+ char* utf8 = autoArray.get();
bungeman-skia 2013/08/22 20:03:09 I like SkAutoSTMalloc<0x100, char> utf8(sizeNeede
SkUTF16_ToUTF8((uint16_t*)text, byteLength / 2, utf8);
decodedText->append(utf8, sizeNeeded);
- delete utf8;
break;
}
case SkPaint::kUTF32_TextEncoding: {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698