From a38e267156bb2f189229cf229c17fb291e15f074 Mon Sep 17 00:00:00 2001 From: thefiddler Date: Fri, 18 Jul 2014 10:05:13 +0200 Subject: [PATCH] [Linux] Additional debugging info on shutdown --- Source/OpenTK/Platform/Linux/LinuxFactory.cs | 3 +++ Source/OpenTK/Platform/Linux/LinuxInput.cs | 6 ++++++ Source/OpenTK/Platform/Linux/LinuxNativeWindow.cs | 5 +++++ 3 files changed, 14 insertions(+) diff --git a/Source/OpenTK/Platform/Linux/LinuxFactory.cs b/Source/OpenTK/Platform/Linux/LinuxFactory.cs index 23a3b2c..21132c1 100644 --- a/Source/OpenTK/Platform/Linux/LinuxFactory.cs +++ b/Source/OpenTK/Platform/Linux/LinuxFactory.cs @@ -169,16 +169,19 @@ namespace OpenTK.Platform.Linux { if (egl_display != IntPtr.Zero) { + Debug.Print("[KMS] Terminating EGL."); Egl.Terminate(egl_display); egl_display = IntPtr.Zero; } if (gbm_device != IntPtr.Zero) { + Debug.Print("[KMS] Destroying GBM device."); Gbm.DestroyDevice(gbm_device); gbm_device = IntPtr.Zero; } if (_fd >= 0) { + Debug.Print("[KMS] Closing GPU fd."); Libc.close(_fd); } diff --git a/Source/OpenTK/Platform/Linux/LinuxInput.cs b/Source/OpenTK/Platform/Linux/LinuxInput.cs index b421b56..c3f435f 100644 --- a/Source/OpenTK/Platform/Linux/LinuxInput.cs +++ b/Source/OpenTK/Platform/Linux/LinuxInput.cs @@ -655,6 +655,7 @@ namespace OpenTK.Platform.Linux { if (input_context != IntPtr.Zero) { + Debug.Print("[Input] Destroying libinput context"); LibInput.Suspend(input_context); Interlocked.Increment(ref exit); @@ -664,12 +665,17 @@ namespace OpenTK.Platform.Linux 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); + } } ~LinuxInput() diff --git a/Source/OpenTK/Platform/Linux/LinuxNativeWindow.cs b/Source/OpenTK/Platform/Linux/LinuxNativeWindow.cs index f3aebbe..a2a5660 100644 --- a/Source/OpenTK/Platform/Linux/LinuxNativeWindow.cs +++ b/Source/OpenTK/Platform/Linux/LinuxNativeWindow.cs @@ -378,9 +378,14 @@ namespace OpenTK.Platform.Linux { if (disposing) { + Debug.Print("[KMS] Destroying window {0}.", window.Handle); window.Dispose(); Gbm.DestroySurface(window.Handle); } + else + { + Debug.Print("[KMS] {0} leaked. Did you forget to call Dispose()?", GetType().FullName); + } } public override Icon Icon -- 2.7.4