WINED3D: Remove some redundant code.

H. Verbeet hverbeet at gmail.com
Mon Jun 26 17:32:32 CDT 2006


As mentioned in bug 5418, there's really no reason to do that check twice.
-------------- next part --------------
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 9e0f00f..2be5692 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -1582,16 +1582,11 @@ static HRESULT WINAPI IWineD3DDeviceImpl
     XFree(object->visInfo);
     object->visInfo = NULL;
 
-    if (NULL == object->glCtx) {
-        ERR("cannot create glxContext\n");
-        LEAVE_GL();
-        return WINED3DERR_NOTAVAILABLE;
-    }
-
     LEAVE_GL();
-    if (object->glCtx == NULL) {
-        ERR("Error in context creation !\n");
-        return WINED3DERR_INVALIDCALL;
+
+    if (!object->glCtx) {
+        ERR("Failed to create GLX context\n");
+        return WINED3DERR_NOTAVAILABLE;
     } else {
         TRACE("Context created (HWND=%p, glContext=%p, Window=%ld, VisInfo=%p)\n",
                 object->win_handle, object->glCtx, object->win, object->visInfo);



More information about the wine-patches mailing list