Mark NSAutoreleasePool.Init() as must-dispose

This commit is contained in:
Dan Balasescu
2025-02-18 18:06:31 +09:00
parent 7249d66349
commit 018fb73034

View File

@@ -2,6 +2,7 @@
// See the LICENCE file in the repository root for full licence text.
using System;
using JetBrains.Annotations;
namespace osu.Framework.Platform.Apple.Native
{
@@ -19,6 +20,7 @@ namespace osu.Framework.Platform.Apple.Native
private static readonly IntPtr sel_init = Selector.Get("init");
private static readonly IntPtr sel_drain = Selector.Get("drain");
[MustDisposeResource]
public static NSAutoreleasePool Init()
=> new NSAutoreleasePool(Interop.SendIntPtr(Interop.SendIntPtr(class_pointer, sel_alloc), sel_init));