aboutsummaryrefslogtreecommitdiffhomepage
path: root/site/user/sample/building.md
diff options
context:
space:
mode:
authorGravatar mdempsky <mdempsky@chromium.org>2015-09-03 12:19:23 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-09-03 12:19:23 -0700
commit214046e8a19ef12fcce1f53cda9982b1c53937fb (patch)
tree32c4ab450ad7b50d992780b568e1f4662a2c8767 /site/user/sample/building.md
parentad54ffc235ea02438a8510feccba9657033b5ec5 (diff)
Fix memory leak in build example
Diffstat (limited to 'site/user/sample/building.md')
-rw-r--r--site/user/sample/building.md7
1 files changed, 3 insertions, 4 deletions
diff --git a/site/user/sample/building.md b/site/user/sample/building.md
index 92865d17b8..2fed87f374 100644
--- a/site/user/sample/building.md
+++ b/site/user/sample/building.md
@@ -260,10 +260,10 @@ int main(int argc, char** argv) {
SkPaint paint;
paint.setColor(SK_ColorRED);
- SkString* str = new SkString();
- paint.toString(str);
+ SkString str;
+ paint.toString(&str);
- fprintf(stdout, "%s\n", str->c_str());
+ fprintf(stdout, "%s\n", str.c_str());
return 0;
}
@@ -317,4 +317,3 @@ sync.
Adding the above to the end of DEPS and running gclient sync should show the
GYP files being updated at the end of the sync procedure.
-