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 <[email protected]>
---
 protocol/wayland.xml | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/protocol/wayland.xml b/protocol/wayland.xml
index 29b63be..aabc7ae 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.
       </description>
       <arg name="registry" type="new_id" interface="wl_registry"
           summary="global registry object"/>
-- 
2.14.1

_______________________________________________
wayland-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/wayland-devel

Reply via email to