Added diagnostic message when ReleaseDC fails.

This commit is contained in:
the_fiddler 2009-05-19 09:45:36 +00:00
parent 2277bf8576
commit 9bdc21cabd

View file

@ -1,6 +1,8 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Text; using System.Text;
using System.Diagnostics;
using System.Runtime.InteropServices;
namespace OpenTK.Platform.Windows namespace OpenTK.Platform.Windows
{ {
@ -95,7 +97,8 @@ namespace OpenTK.Platform.Windows
if (!disposed) if (!disposed)
{ {
if (this.dc != IntPtr.Zero) if (this.dc != IntPtr.Zero)
Functions.ReleaseDC(this.handle, this.dc); if (!Functions.ReleaseDC(this.handle, this.dc))
Debug.Print("[Warning] Failed to release device context {0}. Windows error: {1}.", this.dc, Marshal.GetLastWin32Error());
if (manual) if (manual)
{ {