public virtual void Dispose(bool disposing) { if (handle != IntPtr.Zero) { CFObject.CFRelease(handle); handle = IntPtr.Zero; } }
static string ToString(IntPtr cfStringRef, bool release) { var r = CFString.FetchString(cfStringRef); if (release && (cfStringRef != IntPtr.Zero)) { CFObject.CFRelease(cfStringRef); } return(r); }
protected virtual void Dispose(bool disposing) { if (disposing) { if (gch.IsAllocated) { gch.Free(); } } if (handle != IntPtr.Zero) { CFObject.CFRelease(handle); handle = IntPtr.Zero; } }