<http://webkit.org/b/49867> MediaPlayerPrivateQTKit::setPreservesPitch(bool) leaks...
[WebKit-https.git] / WebCore / platform / graphics / mac / MediaPlayerPrivateQTKit.mm
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