Exemplo n.º 1
0
 protected virtual void Dispose(bool disposing)
 {
     if (handle != IntPtr.Zero)
     {
         CFObject.CFRelease(handle);
         handle = IntPtr.Zero;
     }
 }
Exemplo n.º 2
0
        public virtual void Dispose(bool disposing)
#endif
        {
            if (handle != IntPtr.Zero)
            {
                CFObject.CFRelease(handle);
                handle = IntPtr.Zero;
            }
        }
Exemplo n.º 3
0
        // to be used when an API like CF*Copy* returns a CFString
        internal static string FetchString(IntPtr handle, bool releaseHandle)
        {
            var s = FetchString(handle);

            if (releaseHandle && (handle != IntPtr.Zero))
            {
                CFObject.CFRelease(handle);
            }
            return(s);
        }
Exemplo n.º 4
0
        static string ToString(IntPtr cfStringRef, bool release)
        {
            var r = CFString.FetchString(cfStringRef);

            if (release && (cfStringRef != IntPtr.Zero))
            {
                CFObject.CFRelease(cfStringRef);
            }
            return(r);
        }
Exemplo n.º 5
0
 protected virtual void Dispose(bool disposing)
 {
     if (disposing)
     {
         if (gch.IsAllocated)
         {
             gch.Free();
         }
     }
     if (handle != IntPtr.Zero)
     {
         CFObject.CFRelease(handle);
         handle = IntPtr.Zero;
     }
 }