Skip to content

Commit e160b93

Browse files
authored
[xcode26.4] Merge remote-tracking branch main into xcode26.4 (#24898)
2 parents 90c7c8f + 72192d1 commit e160b93

32 files changed

Lines changed: 773 additions & 148 deletions

File tree

Make.config

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,8 +260,20 @@ MACCATALYST_SDK_VERSION=$(word 1, $(subst ., ,$(MACCATALYST_NUGET_VERSION))).$(w
260260
MAX_IOS_DEPLOYMENT_TARGET=$(IOS_SDK_VERSION)
261261
MAX_TVOS_DEPLOYMENT_TARGET=$(TVOS_SDK_VERSION)
262262

263+
# Decide which OS version we should run the simulator tests in.
264+
# Note that this may not necessarily match the SDK version, if there are OS releases with no API changes, then there wouldn't necessarily be a corresponding SDK version.
265+
# If the errors below trigger, update the hardcoded Xcode version check (currently 26.3) to use the current Xcode version, and assign the corresponding max simulator versions.
266+
ifeq ($(XCODE_VERSION),26.3)
267+
MAX_IOS_SIMULATOR_VERSION=26.3
268+
MAX_TVOS_SIMULATOR_VERSION=26.2
269+
else ifneq ($(XCODE_VERSION),$(IOS_SDK_VERSION))
270+
$(error Check if a max iOS simulator is different than the current SDK version (this happens when there's a new iOS release, with no API changes so no new SDK))
271+
else ifneq ($(XCODE_VERSION),$(TVOS_SDK_VERSION))
272+
$(error Check if a max tvOS simulator is different than the current SDK version (this happens when there's a new tvOS release, with no API changes so no new SDK))
273+
else
263274
MAX_IOS_SIMULATOR_VERSION=$(IOS_SDK_VERSION)
264275
MAX_TVOS_SIMULATOR_VERSION=$(TVOS_SDK_VERSION)
276+
endif
265277

266278
# Minimum OS versions for running XI/XM apps.
267279
MIN_IOS_SDK_VERSION=12.2

NuGet.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<!-- Begin: Package sources from dotnet-dotnet -->
1313
<!-- End: Package sources from dotnet-dotnet -->
1414
<!-- Begin: Package sources from dotnet-macios -->
15-
<add key="darc-pub-dotnet-macios-42038e1" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-macios-42038e18/nuget/v3/index.json" />
15+
<add key="darc-pub-dotnet-macios-b34b8d3" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-macios-b34b8d33/nuget/v3/index.json" />
1616
<!-- End: Package sources from dotnet-macios -->
1717
<!-- Begin: Package sources from xamarin-xamarin-macios -->
1818
<!-- End: Package sources from xamarin-xamarin-macios -->

eng/Version.Details.props

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -5,41 +5,41 @@ This file should be imported by eng/Versions.props
55
-->
66
<Project>
77
<PropertyGroup>
8-
<!-- dotnet/dotnet dependencies -->
9-
<MicrosoftDotNetArcadeSdkPackageVersion>10.0.0-beta.26153.116</MicrosoftDotNetArcadeSdkPackageVersion>
10-
<MicrosoftDotNetBuildTasksFeedPackageVersion>10.0.0-beta.26153.116</MicrosoftDotNetBuildTasksFeedPackageVersion>
8+
<!-- dotnet-dotnet dependencies -->
9+
<MicrosoftDotNetArcadeSdkPackageVersion>10.0.0-beta.26160.113</MicrosoftDotNetArcadeSdkPackageVersion>
10+
<MicrosoftDotNetBuildTasksFeedPackageVersion>10.0.0-beta.26160.113</MicrosoftDotNetBuildTasksFeedPackageVersion>
1111
<MicrosoftDotNetCecilPackageVersion>0.11.5-alpha.26070.104</MicrosoftDotNetCecilPackageVersion>
12-
<MicrosoftDotNetSharedFrameworkSdkPackageVersion>10.0.0-beta.26153.116</MicrosoftDotNetSharedFrameworkSdkPackageVersion>
12+
<MicrosoftDotNetSharedFrameworkSdkPackageVersion>10.0.0-beta.26160.113</MicrosoftDotNetSharedFrameworkSdkPackageVersion>
1313
<MicrosoftNETILLinkPackageVersion>10.0.3-servicing.26070.104</MicrosoftNETILLinkPackageVersion>
1414
<MicrosoftNETILLinkTasksPackageVersion>10.0.3</MicrosoftNETILLinkTasksPackageVersion>
1515
<MicrosoftNETRuntimeMonoTargetsSdkPackageVersion>10.0.3</MicrosoftNETRuntimeMonoTargetsSdkPackageVersion>
16-
<MicrosoftNETSdkPackageVersion>10.0.300-preview.26153.116</MicrosoftNETSdkPackageVersion>
16+
<MicrosoftNETSdkPackageVersion>10.0.300-preview.26160.113</MicrosoftNETSdkPackageVersion>
1717
<MicrosoftNETCoreAppRefPackageVersion>10.0.3</MicrosoftNETCoreAppRefPackageVersion>
18-
<MicrosoftTemplateEngineAuthoringTasksPackageVersion>10.0.300-preview.26153.116</MicrosoftTemplateEngineAuthoringTasksPackageVersion>
19-
<!-- dotnet/macios dependencies -->
18+
<MicrosoftTemplateEngineAuthoringTasksPackageVersion>10.0.300-preview.26160.113</MicrosoftTemplateEngineAuthoringTasksPackageVersion>
19+
<!-- dotnet-macios dependencies -->
2020
<MicrosoftiOSSdknet100_260PackageVersion>26.0.11017</MicrosoftiOSSdknet100_260PackageVersion>
2121
<MicrosoftiOSSdknet90_185PackageVersion>18.5.9227</MicrosoftiOSSdknet90_185PackageVersion>
22-
<MicrosoftiOSSdknet90_262PackageVersion>26.2.9001</MicrosoftiOSSdknet90_262PackageVersion>
22+
<MicrosoftiOSSdknet90_262PackageVersion>26.2.9002</MicrosoftiOSSdknet90_262PackageVersion>
2323
<MicrosoftMacCatalystSdknet100_260PackageVersion>26.0.11017</MicrosoftMacCatalystSdknet100_260PackageVersion>
2424
<MicrosoftMacCatalystSdknet90_185PackageVersion>18.5.9227</MicrosoftMacCatalystSdknet90_185PackageVersion>
25-
<MicrosoftMacCatalystSdknet90_262PackageVersion>26.2.9001</MicrosoftMacCatalystSdknet90_262PackageVersion>
25+
<MicrosoftMacCatalystSdknet90_262PackageVersion>26.2.9002</MicrosoftMacCatalystSdknet90_262PackageVersion>
2626
<MicrosoftmacOSSdknet100_260PackageVersion>26.0.11017</MicrosoftmacOSSdknet100_260PackageVersion>
2727
<MicrosoftmacOSSdknet90_155PackageVersion>15.5.9227</MicrosoftmacOSSdknet90_155PackageVersion>
28-
<MicrosoftmacOSSdknet90_262PackageVersion>26.2.9001</MicrosoftmacOSSdknet90_262PackageVersion>
28+
<MicrosoftmacOSSdknet90_262PackageVersion>26.2.9002</MicrosoftmacOSSdknet90_262PackageVersion>
2929
<MicrosofttvOSSdknet100_260PackageVersion>26.0.11017</MicrosofttvOSSdknet100_260PackageVersion>
3030
<MicrosofttvOSSdknet90_185PackageVersion>18.5.9227</MicrosofttvOSSdknet90_185PackageVersion>
31-
<MicrosofttvOSSdknet90_262PackageVersion>26.2.9001</MicrosofttvOSSdknet90_262PackageVersion>
32-
<!-- xamarin/xamarin-macios dependencies -->
31+
<MicrosofttvOSSdknet90_262PackageVersion>26.2.9002</MicrosofttvOSSdknet90_262PackageVersion>
32+
<!-- dotnet-xharness dependencies -->
33+
<MicrosoftDotNetXHarnessiOSSharedPackageVersion>11.0.0-prerelease.26160.2</MicrosoftDotNetXHarnessiOSSharedPackageVersion>
34+
<!-- xamarin-xamarin-macios dependencies -->
3335
<MicrosoftiOSSdknet90_180PackageVersion>18.0.9617</MicrosoftiOSSdknet90_180PackageVersion>
3436
<MicrosoftMacCatalystSdknet90_180PackageVersion>18.0.9617</MicrosoftMacCatalystSdknet90_180PackageVersion>
3537
<MicrosoftmacOSSdknet90_150PackageVersion>15.0.9617</MicrosoftmacOSSdknet90_150PackageVersion>
3638
<MicrosofttvOSSdknet90_180PackageVersion>18.0.9617</MicrosofttvOSSdknet90_180PackageVersion>
37-
<!-- dotnet/xharness dependencies -->
38-
<MicrosoftDotNetXHarnessiOSSharedPackageVersion>11.0.0-prerelease.26117.1</MicrosoftDotNetXHarnessiOSSharedPackageVersion>
3939
</PropertyGroup>
4040
<!--Property group for alternate package version names-->
4141
<PropertyGroup>
42-
<!-- dotnet/dotnet dependencies -->
42+
<!-- dotnet-dotnet dependencies -->
4343
<MicrosoftDotNetArcadeSdkVersion>$(MicrosoftDotNetArcadeSdkPackageVersion)</MicrosoftDotNetArcadeSdkVersion>
4444
<MicrosoftDotNetBuildTasksFeedVersion>$(MicrosoftDotNetBuildTasksFeedPackageVersion)</MicrosoftDotNetBuildTasksFeedVersion>
4545
<MicrosoftDotNetCecilVersion>$(MicrosoftDotNetCecilPackageVersion)</MicrosoftDotNetCecilVersion>
@@ -50,7 +50,7 @@ This file should be imported by eng/Versions.props
5050
<MicrosoftNETSdkVersion>$(MicrosoftNETSdkPackageVersion)</MicrosoftNETSdkVersion>
5151
<MicrosoftNETCoreAppRefVersion>$(MicrosoftNETCoreAppRefPackageVersion)</MicrosoftNETCoreAppRefVersion>
5252
<MicrosoftTemplateEngineAuthoringTasksVersion>$(MicrosoftTemplateEngineAuthoringTasksPackageVersion)</MicrosoftTemplateEngineAuthoringTasksVersion>
53-
<!-- dotnet/macios dependencies -->
53+
<!-- dotnet-macios dependencies -->
5454
<MicrosoftiOSSdknet100_260Version>$(MicrosoftiOSSdknet100_260PackageVersion)</MicrosoftiOSSdknet100_260Version>
5555
<MicrosoftiOSSdknet90_185Version>$(MicrosoftiOSSdknet90_185PackageVersion)</MicrosoftiOSSdknet90_185Version>
5656
<MicrosoftiOSSdknet90_262Version>$(MicrosoftiOSSdknet90_262PackageVersion)</MicrosoftiOSSdknet90_262Version>
@@ -63,12 +63,12 @@ This file should be imported by eng/Versions.props
6363
<MicrosofttvOSSdknet100_260Version>$(MicrosofttvOSSdknet100_260PackageVersion)</MicrosofttvOSSdknet100_260Version>
6464
<MicrosofttvOSSdknet90_185Version>$(MicrosofttvOSSdknet90_185PackageVersion)</MicrosofttvOSSdknet90_185Version>
6565
<MicrosofttvOSSdknet90_262Version>$(MicrosofttvOSSdknet90_262PackageVersion)</MicrosofttvOSSdknet90_262Version>
66-
<!-- xamarin/xamarin-macios dependencies -->
66+
<!-- dotnet-xharness dependencies -->
67+
<MicrosoftDotNetXHarnessiOSSharedVersion>$(MicrosoftDotNetXHarnessiOSSharedPackageVersion)</MicrosoftDotNetXHarnessiOSSharedVersion>
68+
<!-- xamarin-xamarin-macios dependencies -->
6769
<MicrosoftiOSSdknet90_180Version>$(MicrosoftiOSSdknet90_180PackageVersion)</MicrosoftiOSSdknet90_180Version>
6870
<MicrosoftMacCatalystSdknet90_180Version>$(MicrosoftMacCatalystSdknet90_180PackageVersion)</MicrosoftMacCatalystSdknet90_180Version>
6971
<MicrosoftmacOSSdknet90_150Version>$(MicrosoftmacOSSdknet90_150PackageVersion)</MicrosoftmacOSSdknet90_150Version>
7072
<MicrosofttvOSSdknet90_180Version>$(MicrosofttvOSSdknet90_180PackageVersion)</MicrosofttvOSSdknet90_180Version>
71-
<!-- dotnet/xharness dependencies -->
72-
<MicrosoftDotNetXHarnessiOSSharedVersion>$(MicrosoftDotNetXHarnessiOSSharedPackageVersion)</MicrosoftDotNetXHarnessiOSSharedVersion>
7373
</PropertyGroup>
7474
</Project>

eng/Version.Details.xml

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<Dependencies>
22
<ProductDependencies>
3-
<Dependency Name="Microsoft.NET.Sdk" Version="10.0.300-preview.26153.116">
3+
<Dependency Name="Microsoft.NET.Sdk" Version="10.0.300-preview.26160.113">
44
<Uri>https://github.com/dotnet/dotnet</Uri>
5-
<Sha>cdfa38403fbb85d0c2f582b8dbc522c1df9a9b83</Sha>
5+
<Sha>37ac471dd9cf9b9b784497fa71dcce9045eb1a78</Sha>
66
</Dependency>
77
<Dependency Name="Microsoft.NET.ILLink" Version="10.0.3-servicing.26070.104">
88
<Uri>https://github.com/dotnet/dotnet</Uri>
@@ -60,21 +60,21 @@
6060
<Sha>797d30720e5e629d23eb146935da94cb1b61047e</Sha>
6161
</Dependency>
6262
<!-- This is a subscription of the .NET 9/Xcode 26.2 versions of our packages -->
63-
<Dependency Name="Microsoft.MacCatalyst.Sdk.net9.0_26.2" Version="26.2.9001">
63+
<Dependency Name="Microsoft.MacCatalyst.Sdk.net9.0_26.2" Version="26.2.9002">
6464
<Uri>https://github.com/dotnet/macios</Uri>
65-
<Sha>42038e186c8e8d9ce0f4a4ff0961bb2b061a35eb</Sha>
65+
<Sha>b34b8d33dfd662493a68b1e443fa04071eebe2b6</Sha>
6666
</Dependency>
67-
<Dependency Name="Microsoft.macOS.Sdk.net9.0_26.2" Version="26.2.9001">
67+
<Dependency Name="Microsoft.macOS.Sdk.net9.0_26.2" Version="26.2.9002">
6868
<Uri>https://github.com/dotnet/macios</Uri>
69-
<Sha>42038e186c8e8d9ce0f4a4ff0961bb2b061a35eb</Sha>
69+
<Sha>b34b8d33dfd662493a68b1e443fa04071eebe2b6</Sha>
7070
</Dependency>
71-
<Dependency Name="Microsoft.iOS.Sdk.net9.0_26.2" Version="26.2.9001">
71+
<Dependency Name="Microsoft.iOS.Sdk.net9.0_26.2" Version="26.2.9002">
7272
<Uri>https://github.com/dotnet/macios</Uri>
73-
<Sha>42038e186c8e8d9ce0f4a4ff0961bb2b061a35eb</Sha>
73+
<Sha>b34b8d33dfd662493a68b1e443fa04071eebe2b6</Sha>
7474
</Dependency>
75-
<Dependency Name="Microsoft.tvOS.Sdk.net9.0_26.2" Version="26.2.9001">
75+
<Dependency Name="Microsoft.tvOS.Sdk.net9.0_26.2" Version="26.2.9002">
7676
<Uri>https://github.com/dotnet/macios</Uri>
77-
<Sha>42038e186c8e8d9ce0f4a4ff0961bb2b061a35eb</Sha>
77+
<Sha>b34b8d33dfd662493a68b1e443fa04071eebe2b6</Sha>
7878
</Dependency>
7979
<!-- This is a subscription of the .NET 10/Xcode 26.0 versions of our packages -->
8080
<Dependency Name="Microsoft.MacCatalyst.Sdk.net10.0_26.0" Version="26.0.11017">
@@ -95,25 +95,25 @@
9595
</Dependency>
9696
</ProductDependencies>
9797
<ToolsetDependencies>
98-
<Dependency Name="Microsoft.DotNet.Build.Tasks.Feed" Version="10.0.0-beta.26153.116">
98+
<Dependency Name="Microsoft.DotNet.Build.Tasks.Feed" Version="10.0.0-beta.26160.113">
9999
<Uri>https://github.com/dotnet/dotnet</Uri>
100-
<Sha>cdfa38403fbb85d0c2f582b8dbc522c1df9a9b83</Sha>
100+
<Sha>37ac471dd9cf9b9b784497fa71dcce9045eb1a78</Sha>
101101
</Dependency>
102-
<Dependency Name="Microsoft.DotNet.SharedFramework.Sdk" Version="10.0.0-beta.26153.116">
102+
<Dependency Name="Microsoft.DotNet.SharedFramework.Sdk" Version="10.0.0-beta.26160.113">
103103
<Uri>https://github.com/dotnet/dotnet</Uri>
104-
<Sha>cdfa38403fbb85d0c2f582b8dbc522c1df9a9b83</Sha>
104+
<Sha>37ac471dd9cf9b9b784497fa71dcce9045eb1a78</Sha>
105105
</Dependency>
106-
<Dependency Name="Microsoft.TemplateEngine.Authoring.Tasks" Version="10.0.300-preview.26153.116">
106+
<Dependency Name="Microsoft.TemplateEngine.Authoring.Tasks" Version="10.0.300-preview.26160.113">
107107
<Uri>https://github.com/dotnet/dotnet</Uri>
108-
<Sha>cdfa38403fbb85d0c2f582b8dbc522c1df9a9b83</Sha>
108+
<Sha>37ac471dd9cf9b9b784497fa71dcce9045eb1a78</Sha>
109109
</Dependency>
110-
<Dependency Name="Microsoft.DotNet.XHarness.iOS.Shared" Version="11.0.0-prerelease.26117.1">
110+
<Dependency Name="Microsoft.DotNet.XHarness.iOS.Shared" Version="11.0.0-prerelease.26160.2">
111111
<Uri>https://github.com/dotnet/xharness</Uri>
112-
<Sha>0eeaa60169fe6a95932d29d822e20eb225ce0143</Sha>
112+
<Sha>c32a7777a0f8f7a4fc8d9920d445f5f4b5658d38</Sha>
113113
</Dependency>
114-
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="10.0.0-beta.26153.116">
114+
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="10.0.0-beta.26160.113">
115115
<Uri>https://github.com/dotnet/dotnet</Uri>
116-
<Sha>cdfa38403fbb85d0c2f582b8dbc522c1df9a9b83</Sha>
116+
<Sha>37ac471dd9cf9b9b784497fa71dcce9045eb1a78</Sha>
117117
<SourceBuild RepoName="arcade" ManagedOnly="true" />
118118
</Dependency>
119119
</ToolsetDependencies>

eng/common/core-templates/steps/publish-logs.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ steps:
3131
-runtimeSourceFeed https://ci.dot.net/internal
3232
-runtimeSourceFeedKey '$(dotnetbuilds-internal-container-read-token-base64)'
3333
'$(publishing-dnceng-devdiv-code-r-build-re)'
34-
'$(MaestroAccessToken)'
3534
'$(dn-bot-all-orgs-artifact-feeds-rw)'
3635
'$(akams-client-id)'
3736
'$(microsoft-symbol-server-pat)'

global.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
{
22
"sdk": {
3-
"version": "10.0.300-preview.26153.116",
3+
"version": "10.0.300-preview.26160.113",
44
"paths": [
55
"builds/downloads/dotnet",
66
"$host$"
77
],
88
"errorMessage": "The .NET SDK could not be found, please run 'make dotnet -C builds'."
99
},
1010
"tools": {
11-
"dotnet": "10.0.300-preview.26153.116"
11+
"dotnet": "10.0.300-preview.26160.113"
1212
},
1313
"msbuild-sdks": {
14-
"Microsoft.DotNet.Arcade.Sdk": "10.0.0-beta.26153.116"
14+
"Microsoft.DotNet.Arcade.Sdk": "10.0.0-beta.26160.113"
1515
}
1616
}

src/CoreGraphics/CGFont.cs

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,10 @@ internal CGFont (NativeHandle handle, bool owns)
4848
{
4949
}
5050

51-
static CGFont Create (IntPtr handle)
51+
static CGFont? Create (IntPtr handle)
5252
{
5353
if (handle == IntPtr.Zero)
54-
ObjCRuntime.ThrowHelper.ThrowArgumentNullException (nameof (handle));
54+
return null;
5555
return new CGFont (handle, true);
5656
}
5757

@@ -74,29 +74,27 @@ protected internal override void Release ()
7474
[DllImport (Constants.CoreGraphicsLibrary)]
7575
extern static /* CGFontRef */ IntPtr CGFontCreateWithDataProvider (/* CGDataProviderRef __nullable */ IntPtr provider);
7676

77+
/// <summary>Creates a font from a data provider.</summary>
7778
/// <param name="provider">Data provider that wraps the font.</param>
78-
/// <summary>Creates a font from a data provider.</summary>
79-
/// <returns>The constructed font.</returns>
80-
/// <remarks>
81-
/// <para>
82-
/// You can use this method to create CGFonts from an
83-
/// in-memory representation of the font (for example, to
84-
/// embed binary fonts into your application to prevent easy
85-
/// copying of licensed fonts, or when you fetch the font from
86-
/// a streaming source and do not want to store it on disk).
87-
///
88-
/// </para>
89-
/// <example>
90-
/// <code lang="csharp lang-csharp"><![CDATA[
91-
/// //
79+
/// <returns>The constructed font, or <see langword="null" /> in case of failure.</returns>
80+
/// <remarks>
81+
/// <para>
82+
/// You can use this method to create <see cref="CGFont" /> instances from an
83+
/// in-memory representation of the font (for example, to
84+
/// embed binary fonts into your application to prevent easy
85+
/// copying of licensed fonts, or when you fetch the font from
86+
/// a streaming source and do not want to store it on disk).
87+
/// </para>
88+
/// <example>
89+
/// <code lang="csharp lang-csharp"><![CDATA[
90+
/// //
9291
/// // Load font into byte array from a file.
9392
/// //
94-
/// byte [] myBuffer = File.ReadAllBytes ("demo.ttf");
95-
/// CGFont font = CGFont.CreateFromProvider (new CGDataProvider (myBuffer, 0, myBuffer.Count));
96-
///
93+
/// var myBuffer = File.ReadAllBytes ("demo.ttf");
94+
/// var font = CGFont.CreateFromProvider (new CGDataProvider (myBuffer, 0, myBuffer.Count));
9795
/// ]]></code>
98-
/// </example>
99-
/// </remarks>
96+
/// </example>
97+
/// </remarks>
10098
public static CGFont? CreateFromProvider (CGDataProvider provider)
10199
{
102100
// the API accept a `nil` argument but returns `nil`, we take a shortcut (no native call)
@@ -111,22 +109,24 @@ protected internal override void Release ()
111109
[DllImport (Constants.CoreGraphicsLibrary)]
112110
extern static /* CGFontRef */ IntPtr CGFontCreateWithFontName (/* CFStringRef __nullable */ IntPtr name);
113111

114-
/// <param name="name">To be added.</param>
115-
/// <summary>Creates a new CGFont representing the specified PostScript or full name.</summary>
116-
/// <returns>To be added.</returns>
117-
/// <remarks>To be added.</remarks>
112+
/// <summary>Creates a new <see cref="CGFont" /> representing the specified PostScript or full name.</summary>
113+
/// <param name="name">The PostScript or full name of the font.</param>
114+
/// <returns>The new <see cref="CGFont" />, or <see langword="null" /> if <paramref name="name" /> is <see langword="null" /> or no matching font is found.</returns>
115+
/// <remarks>
116+
/// <para>
117+
/// This method looks up a font by its PostScript name or full
118+
/// name. If no font matching <paramref name="name" /> is found,
119+
/// the method returns <see langword="null" />.
120+
/// </para>
121+
/// </remarks>
118122
public static CGFont? CreateWithFontName (string name)
119123
{
120124
// the API accept a `nil` argument but returns `nil`, we take a shortcut (no native call)
121125
// and have a unit tests to make sure this behavior does not change over time
122126
if (name is null)
123127
return null;
124-
var nameHandle = CFString.CreateNative (name);
125-
try {
126-
return Create (CGFontCreateWithFontName (nameHandle));
127-
} finally {
128-
CFString.ReleaseNative (nameHandle);
129-
}
128+
var nameHandle = new TransientCFString (name);
129+
return Create (CGFontCreateWithFontName (nameHandle));
130130
}
131131

132132
//[DllImport (Constants.CoreGraphicsLibrary)]

0 commit comments

Comments
 (0)