public void Close() { // Windows that do not have a WindowController use released_when_closed // if set to true, the call to Close will release the object, and we will // end up with a double free. // // If that is the case, we take a reference first, and to keep the behavior // we call Dispose after that. if (WindowController == null) { bool released_when_closed = ReleasedWhenClosed; if (released_when_closed) { CFObject.CFRetain(Handle); } _Close(); if (released_when_closed) { Dispose(); } } else { _Close(); } }
public SecCertificate(X509Certificate certificate) { if (certificate == null) { throw new ArgumentNullException("certificate"); } #if XAMARIN_APPLETLS /* * This requires a recent Mono runtime which has the lazily-initialized * certifciates in mscorlib.dll, so we can't use it on XM classic. * * Using 'XAMARIN_APPLETLS' as a conditional because 'XAMCORE_2_0' is * defined for tvos and watch, which have a recent-enough runtime. */ handle = certificate.Impl.GetNativeAppleCertificate(); if (handle != IntPtr.Zero) { CFObject.CFRetain(handle); return; } #endif using (NSData cert = NSData.FromArray(certificate.GetRawCertData())) { Initialize(cert); } }
internal CMClockOrTimebase(IntPtr handle, bool owns) { this.handle = handle; if (!owns) { CFObject.CFRetain(handle); } }
public CGEventSource(IntPtr handle, bool ownsHandle) { if (!ownsHandle) { CFObject.CFRetain(handle); } this.handle = handle; }
internal CFHTTPAuthentication(IntPtr handle, bool owns) { if (!owns) { CFObject.CFRetain(handle); } this.handle = handle; }
internal CGImageMetadata(IntPtr handle, bool owns) { Handle = handle; if (!owns) { CFObject.CFRetain(Handle); } }
internal SecCertificate(IntPtr handle, bool owns) { this.handle = handle; if (!owns) { CFObject.CFRetain(handle); } }
public SecAccess(IntPtr handle, bool owns = false) { this.handle = handle; if (!owns) { CFObject.CFRetain(handle); } }
public SafeKeychainItemHandle(IntPtr handle, bool ownsHandle) : base(handle, ownsHandle) { if (!ownsHandle) { CFObject.CFRetain(handle); } }
internal CGEvent(IntPtr handle, bool ownsHandle) { if (!ownsHandle) { CFObject.CFRetain(handle); } this.handle = handle; }
internal CFHTTPMessage(IntPtr handle, bool owns) { if (!owns) { CFObject.CFRetain(handle); } this.handle = handle; }
internal CTFontDescriptor (IntPtr handle, bool owns) { if (handle == IntPtr.Zero) throw ConstructorError.ArgumentNull (this, "handle"); this.handle = handle; if (!owns) CFObject.CFRetain (handle); }
internal CGImageDestination(IntPtr handle, bool owns) { this.handle = handle; if (!owns) { CFObject.CFRetain(handle); } }
internal SecIdentity(IntPtr handle, bool owns) { this.handle = handle; if (!owns) { CFObject.CFRetain(handle); } }
internal CGColorConversionInfo(IntPtr handle, bool owns) { Handle = handle; if (!owns) { CFObject.CFRetain(Handle); } }
internal VTFrameSilo(IntPtr handle, bool owns) { this.handle = handle; if (!owns) { CFObject.CFRetain(this.handle); } }
internal VTMultiPassStorage(IntPtr handle, bool owns) { this.handle = handle; if (!owns) { CFObject.CFRetain(this.handle); } }
internal VTSession(IntPtr handle, bool owns) { this.handle = handle; if (!owns) { CFObject.CFRetain(this.handle); } }
internal CGImageSource(IntPtr handle, bool owns) { this.handle = handle; if (!owns) { CFObject.CFRetain(handle); } }
internal ABRecord(IntPtr handle, bool owns) { if (!owns) { CFObject.CFRetain(handle); } this.handle = handle; }
public SecKey(IntPtr handle, bool owns) { this.handle = handle; if (!owns) { CFObject.CFRetain(handle); } }
internal ABAddressBook(IntPtr handle, bool owns) { InitConstants.Init(); if (!owns) { CFObject.CFRetain(handle); } this.handle = handle; }
internal CMSampleBuffer(IntPtr handle, bool owns) { if (!owns) { CFObject.CFRetain(handle); } this.handle = handle; }
internal CMFormatDescription(IntPtr handle, bool owns) { if (!owns) { CFObject.CFRetain(handle); } this.handle = handle; }
internal AUGraph(IntPtr handle, bool owns) { this.handle = handle; if (!owns) { CFObject.CFRetain(this.handle); } gcHandle = GCHandle.Alloc(this); }
internal CTRun(IntPtr handle, bool owns) { if (handle == IntPtr.Zero) { throw new ArgumentNullException("handle"); } this.handle = handle; if (!owns) { CFObject.CFRetain(handle); } }
internal CTFontCollection(IntPtr handle, bool owns) { if (handle == IntPtr.Zero) { throw ConstructorError.ArgumentNull(this, "handle"); } this.handle = handle; if (!owns) { CFObject.CFRetain(handle); } }
internal SecPolicy(IntPtr handle, bool owns = false) { if (handle == IntPtr.Zero) { throw new Exception("Invalid handle"); } this.handle = handle; if (!owns) { CFObject.CFRetain(handle); } }
internal SecCertificate(X509CertificateImpl impl) { handle = impl.GetNativeAppleCertificate(); if (handle != IntPtr.Zero) { CFObject.CFRetain(handle); return; } using (NSData cert = NSData.FromArray(impl.GetRawCertData())) { Initialize(cert); } }
internal SecCertificate(IntPtr handle, bool owns) { if (handle == IntPtr.Zero) { throw new Exception("Invalid handle"); } this.handle = handle; if (!owns) { CFObject.CFRetain(handle); } }