diff options
author | Simon Ser <contact@emersion.fr> | 2019-11-16 18:31:33 +0100 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2019-11-25 09:01:46 -0500 |
commit | 5cde35923cafe1630dc6b1113c593d2200a1e4b5 (patch) | |
tree | 9c6b15aed08aaff885a8bce0a865d2b49ac43889 /CONTRIBUTING.md | |
parent | bcd5f7d259690b547d9858d201b1126df78c6451 (diff) |
Simplify globals implementation by removing destructors
Some globals are static and it doesn't make sense to destroy them before
the wl_display. For instance, wl_compositor should be created before the
display is started and shouldn't be destroyed.
For these globals, we can simplify the code by removing the destructor
and stop keeping track of wl_resources (these will be destroyed with the
wl_display by libwayland).
Diffstat (limited to 'CONTRIBUTING.md')
-rw-r--r-- | CONTRIBUTING.md | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 10e3ac22..e8eb8917 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -242,14 +242,12 @@ at least one struct for each interface in the protocol. For instance, ### Globals Global interfaces generally have public constructors and destructors. Their -struct has a field holding the `wl_global` itself, a list of resources clients -created by binding to the global, a destroy signal and a `wl_display` destroy -listener. Example: +struct has a field holding the `wl_global` itself, a destroy signal and a +`wl_display` destroy listener. Example: ```c struct wlr_compositor { struct wl_global *global; - struct wl_list resources; … struct wl_listener display_destroy; @@ -262,8 +260,9 @@ struct wlr_compositor { ``` When the destructor is called, it should emit the destroy signal, remove the -display destroy listener, destroy the `wl_global`, destroy all bound resources -and then destroy the struct. +display destroy listener, destroy the `wl_global` and then destroy the struct. +The destructor can assume all clients and resources have been already +destroyed. ### Resources |