From f6bbc975d30560a4cd73038b1cca840d330ed428 Mon Sep 17 00:00:00 2001 From: Derek Foreman Date: Fri, 29 Sep 2017 13:46:28 -0500 Subject: [PATCH] protocol: Suggest get_registry not be called frequently I've heard some complaints that wl_display.get_registry "leaks" server memory because wl_registry has no destructor. While this isn't strictly true - all those resources are freed when the client disconnects - it's a bit of a gotcha for neophytes. Since wl_registry's version is not requested in any way through wl_display.get_registry, we can't add a destructor request without breaking ABI. So let's be a little more clear about the result of getting too many wl_registry objects. Signed-off-by: Derek Foreman Reviewed-by: Daniel Stone Reviewed-by: Pekka Paalanen --- protocol/wayland.xml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/protocol/wayland.xml b/protocol/wayland.xml index 29b63be7..aabc7aed 100644 --- a/protocol/wayland.xml +++ b/protocol/wayland.xml @@ -57,6 +57,12 @@ This request creates a registry object that allows the client to list and bind the global objects available from the compositor. + + It should be noted that the server side resources consumed in + response to a get_registry request can only be released when the + client disconnects, not when the client side proxy is destroyed. + Therefore, clients should invoke get_registry as infrequently as + possible to avoid wasting memory.