Hi Igor,

We could add the extra checks but you'll just find a problem
elsewhere, as the actual problem is down to calling code that requires
a current graphics context, glGetString is just one instance.

So the key would be ensure that you never go through code that does
any OpenGL calls until you know for certain that the current thread
has graphics context current.

Robert.

On 8/4/06, Igor Kravtchenko <[EMAIL PROTECTED]> wrote:
Hi!

We have noticed some crashes on some very basic video drivers.
These crashes occurred randomly on lines like:

strcmp((const char *)glGetString(GL_VERSION),"1.2")

On such video drivers, glGetString() returned NULL and bam!

The official documentation:
http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/getstring.html

said that glGetString() can indeed fails in some cases like if we call
the function
between glBegin/glEnd.

By considerating the fact that glGetString() can potentially fail some
times in some circumstances,
I wondered if it would not be a great idea to code guard these kind of
code so we never, ever
want to do a straight strcmp() on an unchecked char* pointer.

What do you think about?

Igor.

_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Reply via email to