2011-03-17 Geoffrey Garen <ggaren@apple.com>
authorggaren@apple.com <ggaren@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 17 Mar 2011 23:07:48 +0000 (23:07 +0000)
committerggaren@apple.com <ggaren@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 17 Mar 2011 23:07:48 +0000 (23:07 +0000)
        Reviewed by Oliver Hunt.

        Fixed a leak seen on the buildbot.

        * WebCoreSupport/WebInspectorClient.mm:
        (WebInspectorClient::openInspectorFrontend): Smart pointers are smart.

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

Source/WebKit/mac/ChangeLog
Source/WebKit/mac/WebCoreSupport/WebInspectorClient.mm

index c9dccd0..4595353 100644 (file)
@@ -1,3 +1,12 @@
+2011-03-17  Geoffrey Garen  <ggaren@apple.com>
+
+        Reviewed by Oliver Hunt.
+
+        Fixed a leak seen on the buildbot.
+
+        * WebCoreSupport/WebInspectorClient.mm:
+        (WebInspectorClient::openInspectorFrontend): Smart pointers are smart.
+
 2011-03-16  Jeff Johnson  <github@lapcatsoftware.com>
 
         Reviewed by Alexey Proskuryakov.
index d5a1d95..72b782a 100644 (file)
@@ -102,10 +102,10 @@ void WebInspectorClient::openInspectorFrontend(InspectorController* inspectorCon
     [windowController.get() setInspectorClient:this];
 
     m_frontendPage = core([windowController.get() webView]);
-    WebInspectorFrontendClient* frontendClient = new WebInspectorFrontendClient(m_webView, windowController.get(), inspectorController, m_frontendPage, createFrontendSettings());
-    m_frontendPage->inspectorController()->setInspectorFrontendClient(frontendClient);
-
-    [[m_webView inspector] setFrontend:[[WebInspectorFrontend alloc] initWithFrontendClient:frontendClient]];
+    OwnPtr<WebInspectorFrontendClient> frontendClient = adoptPtr(new WebInspectorFrontendClient(m_webView, windowController.get(), inspectorController, m_frontendPage, createFrontendSettings()));
+    RetainPtr<WebInspectorFrontend> webInspectorFrontend(AdoptNS, [[WebInspectorFrontend alloc] initWithFrontendClient:frontendClient.get()]);
+    [[m_webView inspector] setFrontend:webInspectorFrontend.get()];
+    m_frontendPage->inspectorController()->setInspectorFrontendClient(frontendClient.release());
 }
 
 void WebInspectorClient::highlight(Node* node)