Title: [202041] trunk/Source/WebCore
Revision
202041
Author
[email protected]
Date
2016-06-14 06:10:57 -0700 (Tue, 14 Jun 2016)

Log Message

REGRESSION (r151608): Leak of QTMovieLayer or AVPlayerLayer in -[WebVideoFullscreenController setVideoElement:]
<https://webkit.org/b/158729>

Reviewed by Eric Carlson.

* platform/mac/WebVideoFullscreenController.mm:
(-[WebVideoFullscreenController setVideoElement:]): Use
RetainPtr<> to prevent leaks.
* platform/mac/WebVideoFullscreenHUDWindowController.mm:
Drive-by fix to remove unused <wtf/RetainPtr.h> import.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (202040 => 202041)


--- trunk/Source/WebCore/ChangeLog	2016-06-14 09:58:06 UTC (rev 202040)
+++ trunk/Source/WebCore/ChangeLog	2016-06-14 13:10:57 UTC (rev 202041)
@@ -1,3 +1,16 @@
+2016-06-14  David Kilzer  <[email protected]>
+
+        REGRESSION (r151608): Leak of QTMovieLayer or AVPlayerLayer in -[WebVideoFullscreenController setVideoElement:]
+        <https://webkit.org/b/158729>
+
+        Reviewed by Eric Carlson.
+
+        * platform/mac/WebVideoFullscreenController.mm:
+        (-[WebVideoFullscreenController setVideoElement:]): Use
+        RetainPtr<> to prevent leaks.
+        * platform/mac/WebVideoFullscreenHUDWindowController.mm:
+        Drive-by fix to remove unused <wtf/RetainPtr.h> import.
+
 2016-06-14  Nael Ouedraogo  <[email protected]>
 
         The vector of mediastreams should be passed via a reference to RTCPeerConnection::addTrack()

Modified: trunk/Source/WebCore/platform/mac/WebVideoFullscreenController.mm (202040 => 202041)


--- trunk/Source/WebCore/platform/mac/WebVideoFullscreenController.mm	2016-06-14 09:58:06 UTC (rev 202040)
+++ trunk/Source/WebCore/platform/mac/WebVideoFullscreenController.mm	2016-06-14 13:10:57 UTC (rev 202041)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2009 Apple Inc. All rights reserved.
+ * Copyright (C) 2009-2016 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -37,6 +37,7 @@
 #import <WebCore/HTMLVideoElement.h>
 #import <WebCore/SoftLinking.h>
 #import <objc/runtime.h>
+#import <wtf/RetainPtr.h>
 
 #if USE(QTKIT)
 #import "QTKitSPI.h"
@@ -130,9 +131,9 @@
 #if USE(QTKIT)
         if (_videoElement->platformMedia().type == PlatformMedia::QTMovieType) {
             QTMovie *movie = _videoElement->platformMedia().media.qtMovie;
-            QTMovieLayer *layer = [allocQTMovieLayerInstance() init];
-            [layer setMovie:movie];
-            [self setupVideoOverlay:layer];
+            RetainPtr<QTMovieLayer> layer = adoptNS([allocQTMovieLayerInstance() init]);
+            [layer.get() setMovie:movie];
+            [self setupVideoOverlay:layer.get()];
 
             [[NSNotificationCenter defaultCenter] addObserver:self
                                                      selector:@selector(rateChanged:)
@@ -143,9 +144,9 @@
 #endif
         if (_videoElement->platformMedia().type == PlatformMedia::AVFoundationMediaPlayerType) {
             AVPlayer *player = _videoElement->platformMedia().media.avfMediaPlayer;
-            AVPlayerLayer *layer = [allocAVPlayerLayerInstance() init];
-            [self setupVideoOverlay:layer];
-            [layer setPlayer:player];
+            RetainPtr<AVPlayerLayer> layer = adoptNS([allocAVPlayerLayerInstance() init]);
+            [self setupVideoOverlay:layer.get()];
+            [layer.get() setPlayer:player];
 
             [player addObserver:self forKeyPath:@"rate" options:0 context:nullptr];
         }

Modified: trunk/Source/WebCore/platform/mac/WebVideoFullscreenHUDWindowController.mm (202040 => 202041)


--- trunk/Source/WebCore/platform/mac/WebVideoFullscreenHUDWindowController.mm	2016-06-14 09:58:06 UTC (rev 202040)
+++ trunk/Source/WebCore/platform/mac/WebVideoFullscreenHUDWindowController.mm	2016-06-14 13:10:57 UTC (rev 202041)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2009 Apple Inc. All rights reserved.
+ * Copyright (C) 2009-2016 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -33,7 +33,6 @@
 #import <WebCore/CoreGraphicsSPI.h>
 #import <WebCore/HTMLVideoElement.h>
 #import <WebCoreSystemInterface.h>
-#import <wtf/RetainPtr.h>
 
 using namespace WebCore;
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to