From: Stefanos A Date: Sun, 22 Dec 2013 10:10:05 +0000 (+0100) Subject: Fixed crash in MakeCurrent(null) X-Git-Tag: 1.1-b4^2^2~41^2~39 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=12cceacf608ceddc3d7c0359a28da7409aec0e06;p=platform%2Fcore%2Fcsapi%2Fopentk.git Fixed crash in MakeCurrent(null) MakeCurrent(null) should set the bound device context to zero. --- diff --git a/Source/OpenTK/Platform/Windows/WinGLContext.cs b/Source/OpenTK/Platform/Windows/WinGLContext.cs index 0e727df7..837c3e76 100644 --- a/Source/OpenTK/Platform/Windows/WinGLContext.cs +++ b/Source/OpenTK/Platform/Windows/WinGLContext.cs @@ -279,14 +279,14 @@ namespace OpenTK.Platform.Windows throw new ArgumentException("window", "Must point to a valid window."); success = Wgl.MakeCurrent(wnd.DeviceContext, Handle.Handle); + device_context = wnd.DeviceContext; } else { success = Wgl.MakeCurrent(IntPtr.Zero, IntPtr.Zero); + device_context = IntPtr.Zero; } - device_context = wnd.DeviceContext; - if (!success) { throw new GraphicsContextException(String.Format(