<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, May 8, 2014 at 1:07 PM, Mariusz Ceier <span dir="ltr"><<a href="mailto:mceier+wayland@gmail.com" target="_blank">mceier+wayland@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
   I sent similar patch in the past, and this reply from Pekka may be<br>
still relevant:<br>
<a href="http://lists.freedesktop.org/archives/wayland-devel/2013-December/012691.html" target="_blank">http://lists.freedesktop.org/archives/wayland-devel/2013-December/012691.html</a><br></blockquote><div><br></div><div>
See the reply I just sent out to the above e-mail.<br></div><div>--Jason Ekstrand<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<span class="HOEnZb"><font color="#888888"><br>
Mariusz Ceier<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
<br>
On 8 May 2014 19:38, Neil Roberts <<a href="mailto:neil@linux.intel.com">neil@linux.intel.com</a>> wrote:<br>
> When an output is destroyed it now also destroys any resources that<br>
> were pointing to it. Otherwise if the resource is destroyed after the<br>
> output then the resource would try to remove itself from the resource<br>
> list but the head of the resource list would no longer be valid and it<br>
> would write to invalid memory.<br>
><br>
> This was found using Valgrind. It looks like there is a similar<br>
> problem for weston_pointer_destroy and in that case there is even a<br>
> comment suggesting we should do something about it.<br>
><br>
> <a href="https://bugs.freedesktop.org/show_bug.cgi?id=78415" target="_blank">https://bugs.freedesktop.org/show_bug.cgi?id=78415</a><br>
> ---<br>
>  src/compositor.c | 5 +++++<br>
>  1 file changed, 5 insertions(+)<br>
><br>
> diff --git a/src/compositor.c b/src/compositor.c<br>
> index cd1ca9a..4162315 100644<br>
> --- a/src/compositor.c<br>
> +++ b/src/compositor.c<br>
> @@ -3110,6 +3110,8 @@ weston_compositor_remove_output(struct weston_compositor *compositor,<br>
>  WL_EXPORT void<br>
>  weston_output_destroy(struct weston_output *output)<br>
>  {<br>
> +       struct wl_resource *resource, *tmp;<br>
> +<br>
>         output->destroying = 1;<br>
><br>
>         weston_compositor_remove_output(output->compositor, output);<br>
> @@ -3124,6 +3126,9 @@ weston_output_destroy(struct weston_output *output)<br>
>         output->compositor->output_id_pool &= ~(1 << output->id);<br>
><br>
>         wl_global_destroy(output->global);<br>
> +<br>
> +       wl_resource_for_each_safe(resource, tmp, &output->resource_list)<br>
> +               wl_resource_destroy(resource);<br>
>  }<br>
><br>
>  static void<br>
> --<br>
> 1.9.0<br>
><br>
> _______________________________________________<br>
> wayland-devel mailing list<br>
> <a href="mailto:wayland-devel@lists.freedesktop.org">wayland-devel@lists.freedesktop.org</a><br>
> <a href="http://lists.freedesktop.org/mailman/listinfo/wayland-devel" target="_blank">http://lists.freedesktop.org/mailman/listinfo/wayland-devel</a><br>
_______________________________________________<br>
wayland-devel mailing list<br>
<a href="mailto:wayland-devel@lists.freedesktop.org">wayland-devel@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/wayland-devel" target="_blank">http://lists.freedesktop.org/mailman/listinfo/wayland-devel</a><br>
</div></div></blockquote></div><br></div></div>