<div dir="ltr"><div>Brian,<br><br></div> Please push that. I haven't gotten commit access for myself yet.<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Mar 11, 2014 at 5:42 PM, Brian Paul <span dir="ltr"><<a href="mailto:brianp@vmware.com" target="_blank">brianp@vmware.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On 03/11/2014 05:07 PM, Mike Stroyan wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Commit 6e8d04a caused a leak by allocating ctx->Debug but never freeing it.<br>
Release the memory in _mesa_free_errors_data when destroying a context.<br>
Use FREE to match CALLOC_STRUCT from _mesa_get_debug_state.<br>
---<br>
src/mesa/main/errors.c | 5 ++++-<br>
1 file changed, 4 insertions(+), 1 deletion(-)<br>
<br>
diff --git a/src/mesa/main/errors.c b/src/mesa/main/errors.c<br>
index 8ec6a8c..9151718 100644<br>
--- a/src/mesa/main/errors.c<br>
+++ b/src/mesa/main/errors.c<br>
@@ -969,7 +969,7 @@ _mesa_init_errors(struct gl_context *ctx)<br>
<br>
/**<br>
* Loop through debug group stack tearing down states for<br>
- * filtering debug messages.<br>
+ * filtering debug messages. Then free debug output state.<br>
*/<br>
void<br>
_mesa_free_errors_data(struct gl_context *ctx)<br>
@@ -980,6 +980,9 @@ _mesa_free_errors_data(struct gl_context *ctx)<br>
for (i = 0; i <= ctx->Debug->GroupStackDepth; i++) {<br>
free_errors_data(ctx, i);<br>
}<br>
+ FREE(ctx->Debug);<br>
+ /* set to NULL just in case it is used before context is completely gone. */<br>
+ ctx->Debug = NULL;<br>
}<br>
}<br>
<br>
<br>
</blockquote>
<br></div></div>
Reviewed-by: Brian Paul <<a href="mailto:brianp@vmware.com" target="_blank">brianp@vmware.com</a>><br>
<br>
Thanks, Mike! Do you need me to push this for you?<br>
<br>
<br>
______________________________<u></u>_________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org" target="_blank">mesa-dev@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/mesa-dev" target="_blank">http://lists.freedesktop.org/<u></u>mailman/listinfo/mesa-dev</a><br>
</blockquote></div><br><br clear="all"><br>-- <br><br> Mike Stroyan - Software Architect<br> LunarG, Inc. - The Graphics Experts<br> Cell: (970) 219-7905<br> Email: Mike@LunarG.com<br> Website: <a href="http://www.lunarg.com">http://www.lunarg.com</a>
</div>