Regression(r124135): SVG tests crashing on ports using Cairo
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 31 Jul 2012 16:08:56 +0000 (16:08 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 31 Jul 2012 16:08:56 +0000 (16:08 +0000)
https://bugs.webkit.org/show_bug.cgi?id=92752

Patch by Thiago Marcos P. Santos <thiago.santos@intel.com> on 2012-07-31
Reviewed by Martin Robinson.

* platform/graphics/cairo/PathCairo.cpp:
(WebCore::Path::operator=):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@124212 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/cairo/PathCairo.cpp

index 4fff3c3..1333d5e 100644 (file)
@@ -1,3 +1,13 @@
+2012-07-31  Thiago Marcos P. Santos  <thiago.santos@intel.com>
+
+        Regression(r124135): SVG tests crashing on ports using Cairo
+        https://bugs.webkit.org/show_bug.cgi?id=92752
+
+        Reviewed by Martin Robinson.
+
+        * platform/graphics/cairo/PathCairo.cpp:
+        (WebCore::Path::operator=):
+
 2012-07-31  Sheriff Bot  <webkit.review.bot@gmail.com>
 
         Unreviewed, rolling out r124208.
index e220cba..2022777 100644 (file)
@@ -73,10 +73,18 @@ Path& Path::operator=(const Path& other)
     if (&other == this)
         return *this;
 
-    clear();
-    cairo_t* cr = ensurePlatformPath()->context();
-    OwnPtr<cairo_path_t> pathCopy = adoptPtr(cairo_copy_path(other.platformPath()->context()));
-    cairo_append_path(cr, pathCopy.get());
+    if (other.isNull()) {
+        if (m_path) {
+            delete m_path;
+            m_path = 0;
+        }
+    } else {
+        clear();
+        cairo_t* cr = ensurePlatformPath()->context();
+        OwnPtr<cairo_path_t> pathCopy = adoptPtr(cairo_copy_path(other.platformPath()->context()));
+        cairo_append_path(cr, pathCopy.get());
+    }
+
     return *this;
 }