Title: [92567] trunk/Source/WebCore
Revision
92567
Author
[email protected]
Date
2011-08-06 18:09:06 -0700 (Sat, 06 Aug 2011)

Log Message

Fix a memory leak found via code inspection.

Rubber-stamped by Dan Bernstein.

* platform/mac/PasteboardMac.mm:
(WebCore::Pasteboard::writeSelection): Adopt the newly-allocated WebHTMLConverter
instance so that it does not leak.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (92566 => 92567)


--- trunk/Source/WebCore/ChangeLog	2011-08-06 23:35:18 UTC (rev 92566)
+++ trunk/Source/WebCore/ChangeLog	2011-08-07 01:09:06 UTC (rev 92567)
@@ -1,3 +1,13 @@
+2011-08-06  Mark Rowe  <[email protected]>
+
+        Fix a memory leak found via code inspection.
+
+        Rubber-stamped by Dan Bernstein.
+
+        * platform/mac/PasteboardMac.mm:
+        (WebCore::Pasteboard::writeSelection): Adopt the newly-allocated WebHTMLConverter
+        instance so that it does not leak.
+
 2011-08-05  Darin Adler  <[email protected]>
 
         Fix Timer heap implementation to work with more libraries (other versions of STL)

Modified: trunk/Source/WebCore/platform/mac/PasteboardMac.mm (92566 => 92567)


--- trunk/Source/WebCore/platform/mac/PasteboardMac.mm	2011-08-06 23:35:18 UTC (rev 92566)
+++ trunk/Source/WebCore/platform/mac/PasteboardMac.mm	2011-08-07 01:09:06 UTC (rev 92567)
@@ -150,7 +150,7 @@
 #ifndef BUILDING_ON_LEOPARD
     else {
         // In WebKit2 we are using a different way to create the NSAttributedString from the DOMrange that doesn't require access to the WebView.
-        RetainPtr<WebHTMLConverter> converter = [[WebHTMLConverter alloc] initWithDOMRange:kit(selectedRange)];
+        RetainPtr<WebHTMLConverter> converter(AdoptNS, [[WebHTMLConverter alloc] initWithDOMRange:kit(selectedRange)]);
         if (converter)
             attributedString = [converter.get() attributedString];
     }
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to