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
diff --git a/src/utils/mac/SkCreateCGImageRef.cpp b/src/utils/mac/SkCreateCGImageRef.cpp
index e931901..0677b7b 100644
--- a/src/utils/mac/SkCreateCGImageRef.cpp
+++ b/src/utils/mac/SkCreateCGImageRef.cpp
@@ -174,6 +174,7 @@
private:
CGPDFDocumentRef fDoc;
};
+#define SkAutoPDFRelease(...) SK_REQUIRE_LOCAL_VAR(SkAutoPDFRelease)
static void CGDataProviderReleaseData_FromMalloc(void*, const void* data,
size_t size) {