Index: include/core/SkPathRef.h |
diff --git a/include/core/SkPathRef.h b/include/core/SkPathRef.h |
index 22287894d98cf698d617f90aac6b43bfe3c9e6be..d832944ec340a6a04c573aeb029a8ff5c9cc9dfd 100644 |
--- a/include/core/SkPathRef.h |
+++ b/include/core/SkPathRef.h |
@@ -108,14 +108,7 @@ public: |
/** |
* Gets a path ref with no verbs or points. |
*/ |
- static SkPathRef* CreateEmpty() { |
- static SkPathRef* gEmptyPathRef; |
- if (!gEmptyPathRef) { |
- gEmptyPathRef = SkNEW(SkPathRef); // leak! |
- gEmptyPathRef->computeBounds(); // Premptively avoid a race to clear fBoundsIsDirty. |
- } |
- return SkRef(gEmptyPathRef); |
- } |
+ static SkPathRef* CreateEmpty(); |
/** |
* Returns true if all of the points in this path are finite, meaning there |
@@ -397,6 +390,11 @@ private: |
SkDEBUGCODE(void validate() const;) |
+ /** |
+ * Called the first time someone calls CreateEmpty to actually create the singleton. |
+ */ |
+ static void CreateEmptyImpl(SkPathRef** empty); |
+ |
enum { |
kMinSize = 256, |
}; |