private void Dispose(bool disposing) { if (disposing) { if (input_context != IntPtr.Zero) { Debug.Print("[Input] Destroying libinput context"); LibInput.Suspend(input_context); Interlocked.Increment(ref exit); LibInput.DestroyContext(input_context); input_context = IntPtr.Zero; } if (udev != IntPtr.Zero) { Debug.Print("[Input] Destroying udev context"); Udev.Destroy(udev); udev = IntPtr.Zero; } input_interface = null; } else { Debug.Print("[Input] {0} leaked. Did you forget to call Dispose()?", GetType().FullName); } }
public static extern IntPtr CreateContext(InputInterface @interface, IntPtr user_data, IntPtr udev);
public static extern IntPtr CreateContext(InputInterface @interface, IntPtr user_data, IntPtr udev, string seat_id);
void Dispose(bool disposing) { if (disposing) { if (input_context != IntPtr.Zero) { Debug.Print("[Input] Destroying libinput context"); LibInput.Suspend(input_context); Interlocked.Increment(ref exit); LibInput.DestroyContext(input_context); input_context = IntPtr.Zero; } if (udev != IntPtr.Zero) { Debug.Print("[Input] Destroying udev context"); Udev.Destroy(udev); udev = IntPtr.Zero; } input_interface = null; } else { Debug.Print("[Input] {0} leaked. Did you forget to call Dispose()?", GetType().FullName); } }