static void OverrideCleanup(GLib.GType gtype, CleanupNativeDelegate callback) { unsafe { IntPtr *raw_ptr = (IntPtr *)(((long)gtype.GetClassPtr()) + (long)class_abi.GetFieldOffset("cleanup")); *raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate)callback); } }
private void InternalCleanup() { CleanupNativeDelegate unmanaged = null; unsafe { IntPtr *raw_ptr = (IntPtr *)(((long)this.LookupGType().GetThresholdType().GetClassPtr()) + (long)class_abi.GetFieldOffset("cleanup")); unmanaged = (CleanupNativeDelegate)Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(CleanupNativeDelegate)); } if (unmanaged == null) { return; } unmanaged(this.Handle); }
static void OverrideCleanup (Gst.GLib.GType gtype, CleanupNativeDelegate callback) { GstTaskPoolClass class_iface = GetClassStruct (gtype, false); class_iface.Cleanup = callback; OverrideClassStruct (gtype, class_iface); }