[Mesa-dev] [PATCH 09/13] mesa/main: Don't free unallocated performance monitor
Juha-Pekka Heikkila
juhapekka.heikkila at gmail.com
Tue May 5 04:25:25 PDT 2015
Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila at gmail.com>
---
src/mesa/main/performance_monitor.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/src/mesa/main/performance_monitor.c b/src/mesa/main/performance_monitor.c
index 2d740da..292086c 100644
--- a/src/mesa/main/performance_monitor.c
+++ b/src/mesa/main/performance_monitor.c
@@ -107,9 +107,11 @@ free_performance_monitor(GLuint key, void *data, void *user)
void
_mesa_free_performance_monitors(struct gl_context *ctx)
{
- _mesa_HashDeleteAll(ctx->PerfMonitor.Monitors,
- free_performance_monitor, ctx);
- _mesa_DeleteHashTable(ctx->PerfMonitor.Monitors);
+ if (ctx->PerfMonitor.Monitors) {
+ _mesa_HashDeleteAll(ctx->PerfMonitor.Monitors,
+ free_performance_monitor, ctx);
+ _mesa_DeleteHashTable(ctx->PerfMonitor.Monitors);
+ }
}
static inline struct gl_perf_monitor_object *
--
1.8.5.1
More information about the mesa-dev
mailing list