<p dir="ltr">Remember the problem we had a couple months ago with null surfaces being passed to wl_pointer.leave if the leave was caused by the surface being destroyed? If you set surface->resource = NULL before destroying it this bug will come up again.</p>
<div class="gmail_quote">On Sep 11, 2013 11:28 AM, "Giulio Camuffo" <<a href="mailto:giuliocamuffo@gmail.com">giuliocamuffo@gmail.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
with the surface ref-count feature a surface may live on after its<br>
resource was destroyed. set it to NULL in that case, so that code<br>
like find_resource_for_surface() in input.c will act accordingly.<br>
---<br>
src/compositor.c | 3 +++<br>
1 file changed, 3 insertions(+)<br>
<br>
diff --git a/src/compositor.c b/src/compositor.c<br>
index 88df279..e4ce428 100644<br>
--- a/src/compositor.c<br>
+++ b/src/compositor.c<br>
@@ -1070,6 +1070,9 @@ destroy_surface(struct wl_resource *resource)<br>
{<br>
struct weston_surface *surface = wl_resource_get_user_data(resource);<br>
<br>
+ /* the surface may live so make sure nothing thinks<br>
+ it still has a resource */<br>
+ surface->resource = NULL;<br>
weston_surface_destroy(surface);<br>
}<br>
<br>
--<br>
1.8.4<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>
</blockquote></div>