From e61a86cfa00ea393ecc4a71fca94e1d476a37ecc Mon Sep 17 00:00:00 2001 From: "commit-bot@chromium.org" Date: Mon, 18 Nov 2013 16:03:59 +0000 Subject: Guard against most unintentionally ephemeral SkAutoFoo instantiations. I think I applied the trick everywhere possible. Limitations: - can't be used with templated classes - all constructors and destructors must be defined inline A couple of the SkAutoFoo were unused in Skia, Chromium, and Android, so I deleted them. This change caught the same bugs Cary found in SkPath, plus one more in SampleApp. BUG= R=reed@google.com, caryclark@google.com Author: mtklein@google.com Review URL: https://codereview.chromium.org/72603005 git-svn-id: http://skia.googlecode.com/svn/trunk@12301 2bbb7eff-a529-9590-31e7-b0007b416f81 --- samplecode/SampleLayers.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'samplecode/SampleLayers.cpp') diff --git a/samplecode/SampleLayers.cpp b/samplecode/SampleLayers.cpp index f72c519faf..483943d5d4 100644 --- a/samplecode/SampleLayers.cpp +++ b/samplecode/SampleLayers.cpp @@ -61,7 +61,7 @@ static void test_fade(SkCanvas* canvas) { SkPaint p; p.setAlpha(0x88); - SkAutoCanvasRestore(canvas, false); + SkAutoCanvasRestore ar2(canvas, false); // create the layers -- cgit v1.2.3