Commit c951f692 authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

wined3d: Release the GL lock on IWineD3DImpl_FillGLCaps() error paths.

parent 996e8f0d
...@@ -1481,6 +1481,7 @@ static BOOL IWineD3DImpl_FillGLCaps(struct wined3d_gl_info *gl_info) ...@@ -1481,6 +1481,7 @@ static BOOL IWineD3DImpl_FillGLCaps(struct wined3d_gl_info *gl_info)
TRACE_(d3d_caps)("GL_RENDERER: %s.\n", debugstr_a(gl_string)); TRACE_(d3d_caps)("GL_RENDERER: %s.\n", debugstr_a(gl_string));
if (!gl_string) if (!gl_string)
{ {
LEAVE_GL();
ERR_(d3d_caps)("Received a NULL GL_RENDERER.\n"); ERR_(d3d_caps)("Received a NULL GL_RENDERER.\n");
return FALSE; return FALSE;
} }
...@@ -1489,6 +1490,7 @@ static BOOL IWineD3DImpl_FillGLCaps(struct wined3d_gl_info *gl_info) ...@@ -1489,6 +1490,7 @@ static BOOL IWineD3DImpl_FillGLCaps(struct wined3d_gl_info *gl_info)
gl_renderer = HeapAlloc(GetProcessHeap(), 0, len); gl_renderer = HeapAlloc(GetProcessHeap(), 0, len);
if (!gl_renderer) if (!gl_renderer)
{ {
LEAVE_GL();
ERR_(d3d_caps)("Failed to allocate gl_renderer memory.\n"); ERR_(d3d_caps)("Failed to allocate gl_renderer memory.\n");
return FALSE; return FALSE;
} }
...@@ -1498,6 +1500,7 @@ static BOOL IWineD3DImpl_FillGLCaps(struct wined3d_gl_info *gl_info) ...@@ -1498,6 +1500,7 @@ static BOOL IWineD3DImpl_FillGLCaps(struct wined3d_gl_info *gl_info)
TRACE_(d3d_caps)("GL_VENDOR: %s.\n", debugstr_a(gl_string)); TRACE_(d3d_caps)("GL_VENDOR: %s.\n", debugstr_a(gl_string));
if (!gl_string) if (!gl_string)
{ {
LEAVE_GL();
ERR_(d3d_caps)("Received a NULL GL_VENDOR.\n"); ERR_(d3d_caps)("Received a NULL GL_VENDOR.\n");
HeapFree(GetProcessHeap(), 0, gl_renderer); HeapFree(GetProcessHeap(), 0, gl_renderer);
return FALSE; return FALSE;
...@@ -1510,6 +1513,7 @@ static BOOL IWineD3DImpl_FillGLCaps(struct wined3d_gl_info *gl_info) ...@@ -1510,6 +1513,7 @@ static BOOL IWineD3DImpl_FillGLCaps(struct wined3d_gl_info *gl_info)
TRACE_(d3d_caps)("GL_VERSION: %s.\n", debugstr_a(gl_string)); TRACE_(d3d_caps)("GL_VERSION: %s.\n", debugstr_a(gl_string));
if (!gl_string) if (!gl_string)
{ {
LEAVE_GL();
ERR_(d3d_caps)("Received a NULL GL_VERSION.\n"); ERR_(d3d_caps)("Received a NULL GL_VERSION.\n");
HeapFree(GetProcessHeap(), 0, gl_renderer); HeapFree(GetProcessHeap(), 0, gl_renderer);
return FALSE; return FALSE;
...@@ -1560,11 +1564,14 @@ static BOOL IWineD3DImpl_FillGLCaps(struct wined3d_gl_info *gl_info) ...@@ -1560,11 +1564,14 @@ static BOOL IWineD3DImpl_FillGLCaps(struct wined3d_gl_info *gl_info)
GL_Extensions = (const char *)glGetString(GL_EXTENSIONS); GL_Extensions = (const char *)glGetString(GL_EXTENSIONS);
if (!GL_Extensions) if (!GL_Extensions)
{ {
LEAVE_GL();
ERR_(d3d_caps)("Received a NULL GL_EXTENSIONS.\n"); ERR_(d3d_caps)("Received a NULL GL_EXTENSIONS.\n");
HeapFree(GetProcessHeap(), 0, gl_renderer); HeapFree(GetProcessHeap(), 0, gl_renderer);
return FALSE; return FALSE;
} }
LEAVE_GL();
TRACE_(d3d_caps)("GL_Extensions reported:\n"); TRACE_(d3d_caps)("GL_Extensions reported:\n");
gl_info->supported[WINED3D_GL_EXT_NONE] = TRUE; gl_info->supported[WINED3D_GL_EXT_NONE] = TRUE;
...@@ -1596,8 +1603,6 @@ static BOOL IWineD3DImpl_FillGLCaps(struct wined3d_gl_info *gl_info) ...@@ -1596,8 +1603,6 @@ static BOOL IWineD3DImpl_FillGLCaps(struct wined3d_gl_info *gl_info)
} }
} }
LEAVE_GL();
/* Now work out what GL support this card really has */ /* Now work out what GL support this card really has */
#define USE_GL_FUNC(type, pfn, ext, replace) \ #define USE_GL_FUNC(type, pfn, ext, replace) \
{ \ { \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment