Fix PathRefDebugRef (SK_DEBUG_PATH_REF) case for SkPath copy constructor.
authorbungeman@google.com <bungeman@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>
Wed, 26 Jun 2013 15:53:29 +0000 (15:53 +0000)
committerbungeman@google.com <bungeman@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>
Wed, 26 Jun 2013 15:53:29 +0000 (15:53 +0000)
Review URL: https://codereview.chromium.org/17902003

git-svn-id: http://skia.googlecode.com/svn/trunk@9768 2bbb7eff-a529-9590-31e7-b0007b416f81

include/core/SkPath.h
src/core/SkPath.cpp

index 2488dd8..4e2451b 100644 (file)
@@ -951,7 +951,6 @@ public:
         of SkPathRefs */
     class PathRefDebugRef {
     public:
-        PathRefDebugRef(SkPath* owner);
         PathRefDebugRef(SkPathRef* pr, SkPath* owner);
         ~PathRefDebugRef();
         void reset(SkPathRef* ref);
index e997b80..7497ab2 100644 (file)
 
 #if SK_DEBUG_PATH_REF
 
-SkPath::PathRefDebugRef::PathRefDebugRef(SkPath* owner) : fOwner(owner) {}
-
 SkPath::PathRefDebugRef::PathRefDebugRef(SkPathRef* pr, SkPath* owner)
-: fPathRef(pr)
-, fOwner(owner) {
+    : fPathRef(pr)
+    , fOwner(owner)
+{
     pr->addOwner(owner);
 }
 
@@ -244,7 +243,7 @@ void SkPath::resetFields() {
 
 SkPath::SkPath(const SkPath& that)
 #if SK_DEBUG_PATH_REF
-    : fPathRef(this)
+    : fPathRef(SkRef(that.fPathRef.get()), this)
 #else
     : fPathRef(SkRef(that.fPathRef.get()))
 #endif