[RFC 1/2] server: add wl_guard and convert one user

Rob Bradford rob at robster.org.uk
Mon Mar 5 19:43:47 PST 2012

On 2 March 2012 12:10, Pekka Paalanen <ppaalanen at gmail.com> wrote:
> From: Pekka Paalanen <ppaalanen at gmail.com>
> In wayland and weston code bases we have roughly a dozen destroy
> listeners whose only job is to set a pointer to NULL, if a wl_resource
> object gets destroyed.
> Introduce struct wl_guard as a shorthand for replacing all these trivial
> callbacks.


This is a good thing to have - any background on your choice of
terminology? glib calls this a "weak pointer" -



PS: The reason I ask is for me "guard" is more like something like
g_return_if_fail etc.

More information about the wayland-devel mailing list