[Piglit] [PATCH] util/wfl: unbound the current context before destroying its window

Dylan Baker baker.dylan.c at gmail.com
Wed Oct 1 22:21:05 PDT 2014


Should the subject say 'unbind' rather than 'unbound'?

On Wednesday, October 01, 2014 02:01:57 AM Emil Velikov wrote:
> Otherwise we end up leaking the drawable. Spotted by Valgrind
> 
> Signed-off-by: Emil Velikov <emil.l.velikov at gmail.com>
> ---
> 
> Perhaps we can simplify the call chain for the following a bit
> make_current > make_current_singlepass > special_case31 > 
> make_curren_singlepass...
> 
> But that for another day :P
> 
> -Emil
> 
>  tests/util/piglit-framework-gl/piglit_wfl_framework.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/tests/util/piglit-framework-gl/piglit_wfl_framework.c b/tests/util/piglit-framework-gl/piglit_wfl_framework.c
> index ac99e00..c762b00 100644
> --- a/tests/util/piglit-framework-gl/piglit_wfl_framework.c
> +++ b/tests/util/piglit-framework-gl/piglit_wfl_framework.c
> @@ -458,6 +458,7 @@ special_case_gl31(struct piglit_wfl_framework *wfl_fw,
>  		    "profile if context creation succeeds.",
>  		    context_description, error_verb);
>  
> +	waffle_make_current(wfl_fw->display, NULL, NULL);
>  	waffle_window_destroy(wfl_fw->window);
>  	waffle_context_destroy(wfl_fw->context);
>  	waffle_config_destroy(wfl_fw->config);
> @@ -536,6 +537,7 @@ make_context_current_singlepass(struct piglit_wfl_framework *wfl_fw,
>  	return true;
>  
>  fail:
> +	waffle_make_current(wfl_fw->display, NULL, NULL);
>  	waffle_window_destroy(wfl_fw->window);
>  	waffle_context_destroy(wfl_fw->context);
>  	waffle_config_destroy(wfl_fw->config);
> @@ -645,6 +647,7 @@ fail:
>  void
>  piglit_wfl_framework_teardown(struct piglit_wfl_framework *wfl_fw)
>  {
> +	waffle_make_current(wfl_fw->display, NULL, NULL);
>  	waffle_window_destroy(wfl_fw->window);
>  	waffle_context_destroy(wfl_fw->context);
>  	waffle_config_destroy(wfl_fw->config);
> -- 
> 2.1.0
> 
> _______________________________________________
> Piglit mailing list
> Piglit at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/piglit
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.freedesktop.org/archives/piglit/attachments/20141001/9a365245/attachment.sig>


More information about the Piglit mailing list