[PATCH weston 5/6] input: Emit events on all resources for a client

Rob Bradford robert.bradford at intel.com
Thu Jul 25 05:15:15 PDT 2013

Thanks for the feedback Daniel.

> Implementation-wise, it mostly looks good, but - do we leak
> focus_resource_list and friends when releasing? I can't find where
> they're freed, but if you're freeing empty_list unconditionally,
> you're going to have a bad time ...

The list use here is kinda different to the way we normally use it in
weston. The list isn't embedded in the structure and is instead a
pointer to the memory we malloc to contain the list node.

The focus_resource_list pointer acts as a cache which we only ever use
for iterating. The list may change if the client brings a new resource
online but that will be reflected in the list itself.

In the original set for this I made the focus_resource_list pointer
point to NULL if we had no focus. But that meant I had to change the
iterat macro to check for NULLness and also in a lot more places. The
empty list sentinel is used in place of setting the pointer to NULL.

The memory for the nodes gets freed in the last patch in the set.



More information about the wayland-devel mailing list