Index: src/core/SkData.cpp |
diff --git a/src/core/SkData.cpp b/src/core/SkData.cpp |
index 11cab7e98be73388c67bfecc2845dd8c1278ea92..c5d10775f8024cad028c69dbb7e107325c157586 100644 |
--- a/src/core/SkData.cpp |
+++ b/src/core/SkData.cpp |
@@ -92,14 +92,13 @@ SkData* SkData::PrivateNewWithCopy(const void* srcOrNull, size_t length) { |
/////////////////////////////////////////////////////////////////////////////// |
-SkData* SkData::NewEmptyImpl() { |
- return new SkData(NULL, 0, NULL, NULL); |
-} |
+// As a template argument these must have external linkage. |
+SkData* sk_new_empty_data() { return new SkData(NULL, 0, NULL, NULL); } |
+namespace { void sk_unref_data(SkData* ptr) { return SkSafeUnref(ptr); } } |
-void SkData::DeleteEmpty(SkData* ptr) { SkDELETE(ptr); } |
+SK_DECLARE_STATIC_LAZY_PTR(SkData, empty, sk_new_empty_data, sk_unref_data); |
SkData* SkData::NewEmpty() { |
- SK_DECLARE_STATIC_LAZY_PTR(SkData, empty, NewEmptyImpl, DeleteEmpty); |
return SkRef(empty.get()); |
} |