Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CoreFoundation] Fix memory leak in CFProxySupport. #20713

Merged
merged 1 commit into from
Jun 11, 2024

Conversation

rolfbjarne
Copy link
Member

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.

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
Copy link
Collaborator

📚 [PR Build] Artifacts 📚

Packages generated

View packages

Pipeline on Agent
Hash: [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

✅ 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)

✅ API diff vs stable

Legacy Xamarin (No breaking changes)
.NET (No breaking changes)
Legacy Xamarin (stable) vs .NET

ℹ️ Generator diff

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

Pipeline on Agent
Hash: 2de3a32ed40a804ba64515d46fc8ca2942662bb3 [PR build]

@rolfbjarne rolfbjarne merged commit aff1b3c into xamarin:main Jun 11, 2024
29 checks passed
@rolfbjarne rolfbjarne deleted the fix-cfproxyscript-leak branch June 11, 2024 14:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants