xamarin / xamarin-macios

.NET for iOS, Mac Catalyst, macOS, and tvOS provide open-source bindings of the Apple SDKs for use with .NET managed languages such as C#
Other
2.42k stars 507 forks source link

[CoreFoundation] Fix memory leak in CFProxySupport. #20713

Closed rolfbjarne closed 2 weeks ago

rolfbjarne commented 2 weeks ago

The Xcode 16 release notes have this note:

CFNetwork Resolved Issues

* Fixed: CFNetworkExecuteProxyAutoConfigurationScript and
  CFNetworkExecuteProxyAutoConfigurationURL have always returned a +1
  retained CF type object, but the function declarations were not
  decorated with the CF_RETURNS_RETAINED attribute until iOS 18, macOS 15,
  tvOS 18, and visionOS 2.

  For C-based languages, the clang static analyzer might note if the
  object is leaked. No source code changes are required, but they are
  encouraged to fix the leak.

  For Swift, this changes the return type of these functions from
  Unmanaged<> to the actual CF type returned, which will require a source
  change to fix when compiling with newer SDKs. However, Swift programs
  compiled with older SDKs will continue to work on the new OSes, though
  the returned CF type object will continue to leak as it did prior to
  this change. (126154509)

So update our code accordingly to take into account that CFNetworkExecuteProxyAutoConfigurationScript and CFNetworkExecuteProxyAutoConfigurationURL return retained objects.

vs-mobiletools-engineering-service2 commented 2 weeks ago

:books: [PR Build] Artifacts :books:

Packages generated

View packages * [xamarin.ios-17.3.0.506.pkg](https://dl.internalx.com/wrench/merge/103c69c2959b5a5283f7c9507b4a25440906a636/9705153/package/xamarin.ios-17.3.0.506.pkg) * [xamarin.mac-9.3.0.506.pkg](https://dl.internalx.com/wrench/merge/103c69c2959b5a5283f7c9507b4a25440906a636/9705153/package/xamarin.mac-9.3.0.506.pkg)

Pipeline on Agent Hash: [PR build]

vs-mobiletools-engineering-service2 commented 2 weeks ago

:white_check_mark: API diff for current PR / commit

Legacy Xamarin (No breaking changes) * ~iOS~ (no change detected) * ~tvOS~ (no change detected) * ~watchOS~ (no change detected) * ~macOS~ (no change detected)
NET (empty diffs) * ~iOS~: (empty diff detected) * ~tvOS~: (empty diff detected) * ~MacCatalyst~: (empty diff detected) * ~macOS~: (empty diff detected)

:white_check_mark: API diff vs stable

Legacy Xamarin (No breaking changes) * iOS: [vsdrops](https://vsdrop.corp.microsoft.com/file/v1/xamarin-macios/detected-changes/20240610.8/9705153-1/;/stable-api-comparison/ios-api-diff.html) [gist](https://gist.github.com/vs-mobiletools-engineering-service2/bb3c036468e3ca9d62170b62c2151826) (No breaking changes) * tvOS: [vsdrops](https://vsdrop.corp.microsoft.com/file/v1/xamarin-macios/detected-changes/20240610.8/9705153-1/;/stable-api-comparison/tvos-api-diff.html) [gist](https://gist.github.com/vs-mobiletools-engineering-service2/06e18adc009187faab30b18d249223bb) (No breaking changes) * watchOS: [vsdrops](https://vsdrop.corp.microsoft.com/file/v1/xamarin-macios/detected-changes/20240610.8/9705153-1/;/stable-api-comparison/watchos-api-diff.html) [gist](https://gist.github.com/vs-mobiletools-engineering-service2/0826e6525aa7d125df52c0b26bfab2b3) (No breaking changes) * macOS: [vsdrops](https://vsdrop.corp.microsoft.com/file/v1/xamarin-macios/detected-changes/20240610.8/9705153-1/;/stable-api-comparison/mac-api-diff.html) [gist](https://gist.github.com/vs-mobiletools-engineering-service2/ff22f92445c139f7ae9f6ee7fae2d432) (No breaking changes)
.NET (No breaking changes) * iOS: [vsdrops](https://vsdrop.corp.microsoft.com/file/v1/xamarin-macios/detected-changes/20240610.8/9705153-1/;/stable-api-comparison/diff/dotnet/Microsoft.iOS.Ref/ref/net8.0/Microsoft.iOS.html) [gist](https://gist.github.com/vs-mobiletools-engineering-service2/2f48dd19a9583bd9dc5e0f5b473e2d08) (No breaking changes) * tvOS: [vsdrops](https://vsdrop.corp.microsoft.com/file/v1/xamarin-macios/detected-changes/20240610.8/9705153-1/;/stable-api-comparison/diff/dotnet/Microsoft.tvOS.Ref/ref/net8.0/Microsoft.tvOS.html) [gist](https://gist.github.com/vs-mobiletools-engineering-service2/871db2dfbbc5c1e4a5662e7a59cb3bf7) (No breaking changes) * MacCatalyst: [vsdrops](https://vsdrop.corp.microsoft.com/file/v1/xamarin-macios/detected-changes/20240610.8/9705153-1/;/stable-api-comparison/diff/dotnet/Microsoft.MacCatalyst.Ref/ref/net8.0/Microsoft.MacCatalyst.html) [gist](https://gist.github.com/vs-mobiletools-engineering-service2/c6b1c50c8b798cd89ccf512c09d354fc) (No breaking changes) * macOS: [vsdrops](https://vsdrop.corp.microsoft.com/file/v1/xamarin-macios/detected-changes/20240610.8/9705153-1/;/stable-api-comparison/diff/dotnet/Microsoft.macOS.Ref/ref/net8.0/Microsoft.macOS.html) [gist](https://gist.github.com/vs-mobiletools-engineering-service2/790a0b473a3d7dd42249aa818bda716f) (No breaking changes) * Microsoft.iOS vs Microsoft.MacCatalyst: [vsdrops](https://vsdrop.corp.microsoft.com/file/v1/xamarin-macios/detected-changes/20240610.8/9705153-1/;/stable-api-comparison/diff/dotnet/iOS-MacCatalyst-diff/Microsoft.iOS.Ref/ref/net8.0/Microsoft.iOS.MacCatalyst.html) [gist](https://gist.github.com/vs-mobiletools-engineering-service2/7606d5ea59c098b5c4bb8162b785495d)
Legacy Xamarin (stable) vs .NET * iOS: [vsdrops](https://vsdrop.corp.microsoft.com/file/v1/xamarin-macios/detected-changes/20240610.8/9705153-1/;/stable-api-comparison/diff/dotnet/legacy-diff/Microsoft.iOS.Ref/ref/net8.0/Microsoft.iOS.html) [gist](https://gist.github.com/vs-mobiletools-engineering-service2/7dd97162d2fcd7ed31c0b18d7b701bd1) * tvOS: [vsdrops](https://vsdrop.corp.microsoft.com/file/v1/xamarin-macios/detected-changes/20240610.8/9705153-1/;/stable-api-comparison/diff/dotnet/legacy-diff/Microsoft.tvOS.Ref/ref/net8.0/Microsoft.tvOS.html) [gist](https://gist.github.com/vs-mobiletools-engineering-service2/61f2b86200526c7adf588df5c95dc360) * macOS: [vsdrops](https://vsdrop.corp.microsoft.com/file/v1/xamarin-macios/detected-changes/20240610.8/9705153-1/;/stable-api-comparison/diff/dotnet/legacy-diff/Microsoft.macOS.Ref/ref/net8.0/Microsoft.macOS.html) [gist](https://gist.github.com/vs-mobiletools-engineering-service2/7c38c3c821c083e34f1422da0559f864)

:information_source: Generator diff

Generator Diff: vsdrops (html) vsdrops (raw diff) gist (raw diff) - Please review changes)

Pipeline on Agent Hash: 2de3a32ed40a804ba64515d46fc8ca2942662bb3 [PR build]