summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/mesa/drivers/dri/i965/brw_queryobj.c4
-rw-r--r--src/mesa/drivers/dri/radeon/radeon_queryobj.c3
-rw-r--r--src/mesa/main/queryobj.c9
-rw-r--r--src/mesa/main/queryobj.h3
-rw-r--r--src/mesa/state_tracker/st_cb_queryobj.c4
5 files changed, 16 insertions, 7 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_queryobj.c b/src/mesa/drivers/dri/i965/brw_queryobj.c
index c6bd57130de..c48f8539275 100644
--- a/src/mesa/drivers/dri/i965/brw_queryobj.c
+++ b/src/mesa/drivers/dri/i965/brw_queryobj.c
@@ -36,6 +36,7 @@
* needs.
*/
#include "main/imports.h"
+#include "main/queryobj.h"
#include "brw_context.h"
#include "brw_defines.h"
@@ -239,8 +240,7 @@ brw_delete_query(struct gl_context *ctx, struct gl_query_object *q)
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);
}
/**
diff --git a/src/mesa/drivers/dri/radeon/radeon_queryobj.c b/src/mesa/drivers/dri/radeon/radeon_queryobj.c
index baf7081994c..c75c1e03a4a 100644
--- a/src/mesa/drivers/dri/radeon/radeon_queryobj.c
+++ b/src/mesa/drivers/dri/radeon/radeon_queryobj.c
@@ -29,6 +29,7 @@
#include "radeon_debug.h"
#include "main/imports.h"
+#include "main/queryobj.h"
#include <inttypes.h>
@@ -80,7 +81,7 @@ static void radeonDeleteQuery(struct gl_context *ctx, struct gl_query_object *q)
radeon_bo_unref(query->bo);
}
- free(query);
+ _mesa_delete_query(ctx, q);
}
static void radeonWaitQuery(struct gl_context *ctx, struct gl_query_object *q)
diff --git a/src/mesa/main/queryobj.c b/src/mesa/main/queryobj.c
index 67d1f76a21a..b2740c5ea75 100644
--- a/src/mesa/main/queryobj.c
+++ b/src/mesa/main/queryobj.c
@@ -120,10 +120,15 @@ _mesa_check_query(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);
diff --git a/src/mesa/main/queryobj.h b/src/mesa/main/queryobj.h
index 24a82571db0..ba8336b525a 100644
--- a/src/mesa/main/queryobj.h
+++ b/src/mesa/main/queryobj.h
@@ -48,6 +48,9 @@ _mesa_init_queryobj(struct gl_context *ctx);
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
diff --git a/src/mesa/state_tracker/st_cb_queryobj.c b/src/mesa/state_tracker/st_cb_queryobj.c
index 9694876cd64..14de2431d64 100644
--- a/src/mesa/state_tracker/st_cb_queryobj.c
+++ b/src/mesa/state_tracker/st_cb_queryobj.c
@@ -36,6 +36,7 @@
#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"
@@ -86,8 +87,7 @@ st_DeleteQuery(struct gl_context *ctx, struct gl_query_object *q)
free_queries(pipe, stq);
- free(q->Label);
- free(stq);
+ _mesa_delete_query(ctx, q);
}
static int