[PATCH weston v2] compositor: reset surface's resource field on resource destruction

Giulio Camuffo giuliocamuffo at gmail.com
Wed Sep 11 14:28:54 PDT 2013


Sure, thanks.


2013/9/11 Kristian Høgsberg <hoegsberg at gmail.com>

> On Wed, Sep 11, 2013 at 08:54:13PM +0200, Giulio Camuffo wrote:
> > with the surface ref-count feature a surface may live on after its
> > resource was destroyed. set it to NULL in that case, so that code
> > like find_resource_for_surface() in input.c will act accordingly.
>
> That makes sense, applied.  When you send out a v2 patch can you add a
> brief comment about what changed below the ---?
>
> > ---
>
> (that is, here)
>
> Kristian
>
> >  src/compositor.c | 3 +++
> >  1 file changed, 3 insertions(+)
> >
> > diff --git a/src/compositor.c b/src/compositor.c
> > index 88df279..a79f911 100644
> > --- a/src/compositor.c
> > +++ b/src/compositor.c
> > @@ -1071,6 +1071,9 @@ destroy_surface(struct wl_resource *resource)
> >       struct weston_surface *surface =
> wl_resource_get_user_data(resource);
> >
> >       weston_surface_destroy(surface);
> > +     /* the surface may live so make sure nothing thinks
> > +      it still has a resourc*e */
> > +     surface->resource = NULL;
> >  }
> >
> >  static void
> > --
> > 1.8.4
> >
> > _______________________________________________
> > wayland-devel mailing list
> > wayland-devel at lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/wayland-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/wayland-devel/attachments/20130911/7a2f114c/attachment.html>


More information about the wayland-devel mailing list