From e04288f812bc825433f19de3b64959a2354378f0 Mon Sep 17 00:00:00 2001 From: tomaka Date: Mon, 23 Feb 2015 15:37:23 +0100 Subject: Do not call wglShareLists is ctxt is null --- src/win32/init.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/win32/init.rs b/src/win32/init.rs index 11a5e9f..d468820 100644 --- a/src/win32/init.rs +++ b/src/win32/init.rs @@ -397,7 +397,7 @@ fn create_context(extra: Option<(&gl::wgl_extra::Wgl, &BuilderAttribs<'static>)> None => { unsafe { let ctxt = gl::wgl::CreateContext(hdc as *const libc::c_void); - if !share.is_null() { + if !ctxt.is_null() && !share.is_null() { gl::wgl::ShareLists(share as *const libc::c_void, ctxt); }; ctxt -- cgit v1.2.3