[PATCH 3/5] wined3d: Release the GL lock on IWineD3DImpl_FillGLCaps() error paths.
Henri Verbeet
hverbeet at codeweavers.com
Wed Sep 2 02:27:56 CDT 2009
---
dlls/wined3d/directx.c | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c
index d9608f5..9c79bd5 100644
--- a/dlls/wined3d/directx.c
+++ b/dlls/wined3d/directx.c
@@ -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));
if (!gl_string)
{
+ LEAVE_GL();
ERR_(d3d_caps)("Received a NULL GL_RENDERER.\n");
return FALSE;
}
@@ -1489,6 +1490,7 @@ static BOOL IWineD3DImpl_FillGLCaps(struct wined3d_gl_info *gl_info)
gl_renderer = HeapAlloc(GetProcessHeap(), 0, len);
if (!gl_renderer)
{
+ LEAVE_GL();
ERR_(d3d_caps)("Failed to allocate gl_renderer memory.\n");
return FALSE;
}
@@ -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));
if (!gl_string)
{
+ LEAVE_GL();
ERR_(d3d_caps)("Received a NULL GL_VENDOR.\n");
HeapFree(GetProcessHeap(), 0, gl_renderer);
return FALSE;
@@ -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));
if (!gl_string)
{
+ LEAVE_GL();
ERR_(d3d_caps)("Received a NULL GL_VERSION.\n");
HeapFree(GetProcessHeap(), 0, gl_renderer);
return FALSE;
@@ -1560,11 +1564,14 @@ static BOOL IWineD3DImpl_FillGLCaps(struct wined3d_gl_info *gl_info)
GL_Extensions = (const char *)glGetString(GL_EXTENSIONS);
if (!GL_Extensions)
{
+ LEAVE_GL();
ERR_(d3d_caps)("Received a NULL GL_EXTENSIONS.\n");
HeapFree(GetProcessHeap(), 0, gl_renderer);
return FALSE;
}
+ LEAVE_GL();
+
TRACE_(d3d_caps)("GL_Extensions reported:\n");
gl_info->supported[WINED3D_GL_EXT_NONE] = TRUE;
@@ -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 */
#define USE_GL_FUNC(type, pfn, ext, replace) \
{ \
--
1.6.0.6
More information about the wine-patches
mailing list