[RFC] [PATCH] Renamed client side wl_display_destroy() to wl_display_disconnect()

Kristian Hoegsberg hoegsberg at gmail.com
Tue Feb 28 11:23:03 PST 2012


On Mon, Feb 27, 2012 at 05:10:03PM +0100, Samuel Rødal wrote:
> The only problem I see with this is that the "disconnect" naming can
> be confusing as the wl_display handle is actually freed as well.

I like it, it pairs better with wl_display_connect.  I don't think
it's a problem that the name is less clear about destruction, we just
need to document it.

Kristian

> From 78588a8c322b9304aea658ea96673cac9cc52a68 Mon Sep 17 00:00:00 2001
> From: =?UTF-8?q?Samuel=20R=C3=B8dal?= <samuel.rodal at nokia.com>
> Date: Mon, 27 Feb 2012 17:03:42 +0100
> Subject: [PATCH] Renamed client side wl_display_destroy() to wl_display_disconnect()
> 
> This avoids the clash with the wayland-server version with the same
> name, and allows linking against both wayland-client and wayland-server
> at the same time, which can be useful for unit testing purposes as
> well as for nested compositing.
> 
> Without this there will be crashes as the wrong wl_display_destroy()
> is called.
> ---
>  src/wayland-client.c |    2 +-
>  src/wayland-client.h |    2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/src/wayland-client.c b/src/wayland-client.c
> index bbfc035..6712c32 100644
> --- a/src/wayland-client.c
> +++ b/src/wayland-client.c
> @@ -397,7 +397,7 @@ wl_display_connect(const char *name)
>  }
>  
>  WL_EXPORT void
> -wl_display_destroy(struct wl_display *display)
> +wl_display_disconnect(struct wl_display *display)
>  {
>  	struct wl_global *global, *gnext;
>  	struct wl_global_listener *listener, *lnext;
> diff --git a/src/wayland-client.h b/src/wayland-client.h
> index efeee4a..b04a7ef 100644
> --- a/src/wayland-client.h
> +++ b/src/wayland-client.h
> @@ -71,7 +71,7 @@ typedef int (*wl_display_update_func_t)(uint32_t mask, void *data);
>  typedef void (*wl_callback_func_t)(void *data, uint32_t time);
>  
>  struct wl_display *wl_display_connect(const char *name);
> -void wl_display_destroy(struct wl_display *display);
> +void wl_display_disconnect(struct wl_display *display);
>  int wl_display_get_fd(struct wl_display *display,
>  		      wl_display_update_func_t update, void *data);
>  void wl_display_iterate(struct wl_display *display, uint32_t mask);
> -- 
> 1.7.1
> 

> _______________________________________________
> wayland-devel mailing list
> wayland-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/wayland-devel



More information about the wayland-devel mailing list