GLX: Fixed context destroy.

This commit is contained in:
Branimir Karadžić 2015-03-25 21:23:48 -07:00
parent a797b00a7f
commit b19c391570

View file

@ -58,7 +58,7 @@ namespace bgfx { namespace gl
m_context = (GLXContext)g_bgfxGLX; m_context = (GLXContext)g_bgfxGLX;
if (NULL == m_context) if (NULL == g_bgfxGLX)
{ {
XLockDisplay( (::Display*)g_bgfxX11Display); XLockDisplay( (::Display*)g_bgfxX11Display);
@ -216,9 +216,14 @@ namespace bgfx { namespace gl
void GlContext::destroy() void GlContext::destroy()
{ {
glXMakeCurrent( (::Display*)g_bgfxX11Display, 0, 0); glXMakeCurrent( (::Display*)g_bgfxX11Display, 0, 0);
if (NULL == g_bgfxGLX)
{
glXDestroyContext( (::Display*)g_bgfxX11Display, m_context); glXDestroyContext( (::Display*)g_bgfxX11Display, m_context);
XFree(m_visualInfo); XFree(m_visualInfo);
} }
m_context = NULL;
m_visualInfo = NULL;
}
void GlContext::resize(uint32_t /*_width*/, uint32_t /*_height*/, bool _vsync) void GlContext::resize(uint32_t /*_width*/, uint32_t /*_height*/, bool _vsync)
{ {