]> git.cworth.org Git - apitrace/blobdiff - retrace/glretrace.py
don't call glGetError if there is no active context
[apitrace] / retrace / glretrace.py
index 32d6a63e95b2108fa21f11e36d5c588a06630dd9..e2ea3201bf183bd63597a964b11f95bcc101424f 100644 (file)
@@ -363,7 +363,7 @@ class GlRetracer(Retracer):
         # Error checking
         if function.name.startswith('gl'):
             # glGetError is not allowed inside glBegin/glEnd
-            print '    if (retrace::debug && !glretrace::insideGlBeginEnd) {'
+            print '    if (retrace::debug && !glretrace::insideGlBeginEnd && glretrace::getCurrentContext()) {'
             print '        glretrace::checkGlError(call);'
             if function.name in ('glProgramStringARB', 'glProgramStringNV'):
                 print r'        GLint error_position = -1;'