Skip to content
This repository was archived by the owner on Dec 12, 2024. It is now read-only.

Commit 2f77a2d

Browse files
author
Stephen Hawley
committed
Fixing reference issue.
1 parent 260464e commit 2f77a2d

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

SwiftRuntimeLibrary/SwiftAnyObject.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,10 @@
77

88
namespace SwiftRuntimeLibrary {
99
public sealed class SwiftAnyObject : SwiftNativeObject {
10-
SwiftAnyObject(IntPtr ptr)
10+
SwiftAnyObject (IntPtr ptr)
1111
: base (ptr, GetSwiftMetatype (), SwiftObjectRegistry.Registry)
1212
{
13+
SwiftCore.Retain (ptr);
1314
}
1415

1516
~SwiftAnyObject ()
@@ -22,7 +23,7 @@ public static SwiftAnyObject XamarinFactory (IntPtr p)
2223
return new SwiftAnyObject (p);
2324
}
2425

25-
public static SwiftAnyObject FromISwiftObject(ISwiftObject obj)
26+
public static SwiftAnyObject FromISwiftObject (ISwiftObject obj)
2627
{
2728
if (obj == null)
2829
throw new ArgumentNullException (nameof (obj));
@@ -37,7 +38,7 @@ public static SwiftMetatype GetSwiftMetatype ()
3738
public T CastAs<T> () where T : class, ISwiftObject
3839
{
3940
var metaType = StructMarshal.Marshaler.Metatypeof (typeof (T));
40-
using (var optional = SwiftOptional<T>.None()) {
41+
using (var optional = SwiftOptional<T>.None ()) {
4142
unsafe {
4243
fixed (byte* dataPtr = StructMarshal.Marshaler.PrepareNominal (optional)) {
4344
NativeMethodsForSwiftAnyObject.CastAs (new IntPtr (dataPtr), SwiftObject, metaType);
@@ -51,8 +52,7 @@ public T CastAs<T> () where T : class, ISwiftObject
5152
}
5253

5354
internal static class NativeMethodsForSwiftAnyObject {
54-
[DllImport(SwiftCore.kXamGlue, EntryPoint = XamGlueConstants.SwiftAnyObject_CastAs)]
55+
[DllImport (SwiftCore.kXamGlue, EntryPoint = XamGlueConstants.SwiftAnyObject_CastAs)]
5556
public static extern void CastAs (IntPtr retval, IntPtr obj, SwiftMetatype meta);
5657
}
57-
}
58-
58+
}

0 commit comments

Comments
 (0)