* needs.
*/
#include "main/imports.h"
+#include "main/queryobj.h"
#include "brw_context.h"
#include "brw_defines.h"
struct brw_query_object *query = (struct brw_query_object *)q;
brw_bo_unreference(query->bo);
- free(query->Base.Label);
- free(query);
+ _mesa_delete_query(ctx, q);
}
/**
#include "radeon_debug.h"
#include "main/imports.h"
+#include "main/queryobj.h"
#include <inttypes.h>
radeon_bo_unref(query->bo);
}
- free(query);
+ _mesa_delete_query(ctx, q);
}
static void radeonWaitQuery(struct gl_context *ctx, struct gl_query_object *q)
/**
- * Delete a query object. Called via ctx->Driver.DeleteQuery().
+ * Delete a query object. Called via ctx->Driver.DeleteQuery(), if not
+ * overwritten by driver. In the latter case, called from the driver
+ * after all driver-specific clean-up has been done.
* Not removed from hash table here.
+ *
+ * \param ctx GL context to wich query object belongs.
+ * \param q query object due to be deleted.
*/
-static void
+void
_mesa_delete_query(struct gl_context *ctx, struct gl_query_object *q)
{
free(q->Label);
extern void
_mesa_free_queryobj_data(struct gl_context *ctx);
+extern void
+_mesa_delete_query(struct gl_context *ctx, struct gl_query_object *q);
+
void GLAPIENTRY
_mesa_GenQueries(GLsizei n, GLuint *ids);
void GLAPIENTRY
#include "main/imports.h"
#include "main/compiler.h"
#include "main/context.h"
+#include "main/queryobj.h"
#include "pipe/p_context.h"
#include "pipe/p_defines.h"
free_queries(pipe, stq);
- free(q->Label);
- free(stq);
+ _mesa_delete_query(ctx, q);
}
static int