[try nr 3]glGetString() should return NULL on NULL context - Solves bug 13599

Massimo Del Fedele max at veneto.com
Wed Jul 2 10:01:42 CDT 2008


From: Massimo Del Fedele<max at veneto.com>
Date: Wed, 2 Jul 2008 16:51:26 +0200
Subject: glGetString() should return NULL on NULL context
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="------------1.5.4.3"

This is a multi-part message in MIME format.
--------------1.5.4.3
Content-Type: text/plain; charset=UTF-8; format=fixed
Content-Transfer-Encoding: 8bit

---
  dlls/opengl32/wgl.c |    6 ++++++
  1 files changed, 6 insertions(+), 0 deletions(-)
--------------1.5.4.3
Content-Type: text/x-patch; 
name="695bfd138854df653ee1e625b49e474dd5003152.diff"
Content-Transfer-Encoding: 8bit
Content-Disposition: attachment; 
filename="695bfd138854df653ee1e625b49e474dd5003152.diff"

diff --git a/dlls/opengl32/wgl.c b/dlls/opengl32/wgl.c
index 6fbdeb4..610bc7d 100644
--- a/dlls/opengl32/wgl.c
+++ b/dlls/opengl32/wgl.c
@@ -632,6 +632,12 @@ const GLubyte * WINAPI wine_glGetString( GLenum name )
    const GLubyte *ret;
    const char* GL_Extensions = NULL;

+  /* this is for buggy nvidia driver, crashing if called from a different
+     thread with no context... we just check for a valid context, and
+     return NULL if none */
+  if(wglGetCurrentContext() == NULL)
+    return NULL;
+
    if (GL_EXTENSIONS != name) {
      ENTER_GL();
      ret = glGetString(name);

--------------1.5.4.3--




More information about the wine-patches mailing list