mesa: Allow setting GL_TEXTURE_MAX_LEVEL to 0 with GL_TEXTURE_RECTANGLE.
[mesa.git] / src / mesa / main / errors.c
index 91f62dac42ce39cea150a6beae357fc465da4872..9151718eab6c45491950d2df54bc39f37372037d 100644 (file)
@@ -524,6 +524,8 @@ validate_params(struct gl_context *ctx, unsigned caller,
    case GL_DEBUG_TYPE_OTHER_ARB:
    case GL_DEBUG_TYPE_MARKER:
       break;
+   case GL_DEBUG_TYPE_PUSH_GROUP:
+   case GL_DEBUG_TYPE_POP_GROUP:
    case GL_DONT_CARE:
       if (caller == CONTROL)
          break;
@@ -967,7 +969,7 @@ _mesa_init_errors(struct gl_context *ctx)
 
 /**
  * Loop through debug group stack tearing down states for
- * filtering debug messages.
+ * filtering debug messages.  Then free debug output state.
  */
 void
 _mesa_free_errors_data(struct gl_context *ctx)
@@ -978,6 +980,9 @@ _mesa_free_errors_data(struct gl_context *ctx)
       for (i = 0; i <= ctx->Debug->GroupStackDepth; i++) {
          free_errors_data(ctx, i);
       }
+      FREE(ctx->Debug);
+      /* set to NULL just in case it is used before context is completely gone. */
+      ctx->Debug = NULL;
    }
 }