aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2020-06-05 16:44:40 +0200
committerDrew DeVault <sir@cmpwn.com>2020-06-08 10:12:38 -0600
commit9b85a8b43dae9c6323348c3f7b033c0ef3a68906 (patch)
treeeb16039dabfea9ff2b79935d92112c68557430a3
parentfd0a845cb4c459374051b0109a3ed3c5d3efbd3d (diff)
contributing: add note about events that destroy objects
-rw-r--r--CONTRIBUTING.md8
1 files changed, 6 insertions, 2 deletions
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index cb75e6d5..bafbffd0 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -293,9 +293,13 @@ this correctly.
Object structs should only be destroyed when their resource is destroyed, ie.
in the resource destroy handler (set with `wl_resource_set_implementation`).
-Destructor requests should only call `wl_resource_destroy`.
-The compositor should not destroy resources on its own.
+- If the object has a destructor request: the request handler should just call
+ `wl_resource_destroy` and do nothing else. The compositor must not destroy
+ resources on its own outside the destructor request handler.
+- If the protocol specifies that an object is destroyed when an event is sent:
+ it's the only case where the compositor is allowed to send the event and then
+ call `wl_resource_destroy`. An example of this is `wl_callback`.
### Inert resources