2009-01-02 Simon Fraser <simon.fraser@apple.com>
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 2 Jan 2009 21:22:29 +0000 (21:22 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 2 Jan 2009 21:22:29 +0000 (21:22 +0000)
        Reviewed by Darin Adler

        Use an OwnPtr for m_chromeClient.

        * svg/graphics/SVGImage.cpp:
        (WebCore::SVGImage::~SVGImage):
        (WebCore::SVGImage::dataChanged):
        * svg/graphics/SVGImage.h:

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

WebCore/ChangeLog
WebCore/svg/graphics/SVGImage.cpp
WebCore/svg/graphics/SVGImage.h

index 60ed385..16be486 100644 (file)
 
         Reviewed by Darin Adler
 
+        Use an OwnPtr for m_chromeClient.
+        
+        * svg/graphics/SVGImage.cpp:
+        (WebCore::SVGImage::~SVGImage):
+        (WebCore::SVGImage::dataChanged):
+        * svg/graphics/SVGImage.h:
+
+2009-01-02  Simon Fraser  <simon.fraser@apple.com>
+
+        Reviewed by Darin Adler
+
         https://bugs.webkit.org/show_bug.cgi?id=22981
 
         Repaints inside of an SVGImage were thrown on the floor,
index a45b198..5bc7018 100644 (file)
@@ -96,7 +96,6 @@ SVGImage::~SVGImage()
     
     // Verify that page teardown destroyed the Chrome
     ASSERT(!m_chromeClient->image());
-    delete m_chromeClient;
 }
 
 void SVGImage::setContainerSize(const IntSize& containerSize)
@@ -227,11 +226,11 @@ bool SVGImage::dataChanged(bool allDataReceived)
         static DragClient* dummyDragClient = new EmptyDragClient;
         static InspectorClient* dummyInspectorClient = new EmptyInspectorClient;
 
-        m_chromeClient = new SVGImageChromeClient(this);
+        m_chromeClient.set(new SVGImageChromeClient(this));
         
         // FIXME: If this SVG ends up loading itself, we'll leak this Frame (and associated DOM & render trees).
         // The Cache code does not know about CachedImages holding Frames and won't know to break the cycle.
-        m_page.set(new Page(m_chromeClient, dummyContextMenuClient, dummyEditorClient, dummyDragClient, dummyInspectorClient));
+        m_page.set(new Page(m_chromeClient.get(), dummyContextMenuClient, dummyEditorClient, dummyDragClient, dummyInspectorClient));
         m_page->settings()->setJavaScriptEnabled(false);
         m_page->settings()->setPluginsEnabled(false);
 
index 80f61e6..b604353 100644 (file)
@@ -72,7 +72,7 @@ private:
         virtual NativeImagePtr nativeImageForCurrentFrame();
         
         SVGDocument* m_document;
-        SVGImageChromeClient* m_chromeClient;
+        OwnPtr<SVGImageChromeClient> m_chromeClient;
         OwnPtr<Page> m_page;
         RefPtr<Frame> m_frame;
         RefPtr<FrameView> m_frameView;