Title: [284481] trunk/Source/WebCore
Revision
284481
Author
ddkil...@apple.com
Date
2021-10-19 12:56:12 -0700 (Tue, 19 Oct 2021)

Log Message

Fix leak of CGColorSpaceRef in FilterEffectRendererCoreImage::sharedCIContext()
<https://webkit.org/b/231902>
<rdar://problem/84375203>

Reviewed by Wenson Hsieh.

* platform/graphics/coreimage/FilterEffectRendererCoreImage.mm:
(WebCore::FilterEffectRendererCoreImage::sharedCIContext):
- Use adoptCF() to fix the leak.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (284480 => 284481)


--- trunk/Source/WebCore/ChangeLog	2021-10-19 19:49:50 UTC (rev 284480)
+++ trunk/Source/WebCore/ChangeLog	2021-10-19 19:56:12 UTC (rev 284481)
@@ -1,3 +1,15 @@
+2021-10-19  David Kilzer  <ddkil...@apple.com>
+
+        Fix leak of CGColorSpaceRef in FilterEffectRendererCoreImage::sharedCIContext()
+        <https://webkit.org/b/231902>
+        <rdar://problem/84375203>
+
+        Reviewed by Wenson Hsieh.
+
+        * platform/graphics/coreimage/FilterEffectRendererCoreImage.mm:
+        (WebCore::FilterEffectRendererCoreImage::sharedCIContext):
+        - Use adoptCF() to fix the leak.
+
 2021-10-19  Alex Christensen  <achristen...@webkit.org>
 
         Origin of opaque blob: URLs ends up as empty string

Modified: trunk/Source/WebCore/platform/graphics/coreimage/FilterEffectRendererCoreImage.mm (284480 => 284481)


--- trunk/Source/WebCore/platform/graphics/coreimage/FilterEffectRendererCoreImage.mm	2021-10-19 19:49:50 UTC (rev 284480)
+++ trunk/Source/WebCore/platform/graphics/coreimage/FilterEffectRendererCoreImage.mm	2021-10-19 19:56:12 UTC (rev 284481)
@@ -1,5 +1,5 @@
 /*
-* Copyright (C) 2020 Apple Inc. All rights reserved.
+* Copyright (C) 2020-2021 Apple Inc. All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
@@ -42,6 +42,7 @@
 #import <CoreImage/CIFilter.h>
 #import <CoreImage/CoreImage.h>
 #import <wtf/NeverDestroyed.h>
+#import <wtf/cocoa/TypeCastsCocoa.h>
 
 namespace WebCore {
 
@@ -54,7 +55,7 @@
 
 RetainPtr<CIContext> FilterEffectRendererCoreImage::sharedCIContext()
 {
-    static NeverDestroyed<RetainPtr<CIContext>> ciContext = [CIContext contextWithOptions: @{ kCIContextWorkingColorSpace: (__bridge id)CGColorSpaceCreateWithName(kCGColorSpaceSRGB)}];
+    static NeverDestroyed<RetainPtr<CIContext>> ciContext = [CIContext contextWithOptions:@{ kCIContextWorkingColorSpace: bridge_id_cast(adoptCF(CGColorSpaceCreateWithName(kCGColorSpaceSRGB))).get() }];
     return ciContext;
 }
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to