<http://webkit.org/b/49867> MediaPlayerPrivateQTKit::setPreservesPitch(bool) leaks...
authorddkilzer@apple.com <ddkilzer@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 20 Nov 2010 20:12:14 +0000 (20:12 +0000)
committerddkilzer@apple.com <ddkilzer@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 20 Nov 2010 20:12:14 +0000 (20:12 +0000)
Reviewed by Dan Bernstein.

* platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
(WebCore::MediaPlayerPrivateQTKit::setPreservesPitch): Use
RetainPtr<NSDictionary> for movieAttributes.

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

WebCore/ChangeLog
WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.mm

index 63e7c707e5c6d922dabb2ffa60d56dc2b6bf227a..557c00f5ed294c4e08f2c46fdae064b38fec5b92 100644 (file)
@@ -1,3 +1,13 @@
+2010-11-20  David Kilzer  <ddkilzer@apple.com>
+
+        <http://webkit.org/b/49867> MediaPlayerPrivateQTKit::setPreservesPitch(bool) leaks an NSDictionary
+
+        Reviewed by Dan Bernstein.
+
+        * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
+        (WebCore::MediaPlayerPrivateQTKit::setPreservesPitch): Use
+        RetainPtr<NSDictionary> for movieAttributes.
+
 2010-11-20  Patrick Gansterer  <paroga@webkit.org>
 
         Reviewed by Andreas Kling.
index a2325da6ba9dcacc413d1b5d7ee7ee54f28041ec..6da0da14cd5aacb9cd18de3af9f5b8150bfd0725 100644 (file)
@@ -896,12 +896,12 @@ void MediaPlayerPrivateQTKit::setPreservesPitch(bool preservesPitch)
     if ([[m_qtMovie.get() attributeForKey:QTMovieRateChangesPreservePitchAttribute] boolValue] == preservesPitch)
         return;
 
-    NSDictionary *movieAttributes = [[m_qtMovie.get() movieAttributes] mutableCopy];
+    RetainPtr<NSDictionary> movieAttributes(AdoptNS, [[m_qtMovie.get() movieAttributes] mutableCopy]);
     ASSERT(movieAttributes);
-    [movieAttributes setValue:[NSNumber numberWithBool:preservesPitch] forKey:QTMovieRateChangesPreservePitchAttribute];
+    [movieAttributes.get() setValue:[NSNumber numberWithBool:preservesPitch] forKey:QTMovieRateChangesPreservePitchAttribute];
     m_timeToRestore = currentTime();
 
-    createQTMovie([movieAttributes valueForKey:QTMovieURLAttribute], movieAttributes);
+    createQTMovie([movieAttributes.get() valueForKey:QTMovieURLAttribute], movieAttributes.get());
 }
 
 PassRefPtr<TimeRanges> MediaPlayerPrivateQTKit::buffered() const