From 0c1a21e75cd5b87181db8ee4cdf303a68eecabed Mon Sep 17 00:00:00 2001 From: Michele Caini Date: Mon, 10 Aug 2020 00:06:45 +0200 Subject: [PATCH] doc: added a note about Emitter::clear (close #217) --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 5b9f199a..2f4dad34 100644 --- a/README.md +++ b/README.md @@ -366,6 +366,10 @@ Both of them return an object of type `ResourceType::Connection` (as an example, A connection object can be used later as an argument to the `erase` member function of the resource to remove the listener.
There exists also the `clear` member function to drop all the listeners at once. +Note that `clear` should only be invoked on non-active handles. The handles +exploit the same event mechanism made available to users to satisfy pending +requests. Invoking `clear` on an active handle, for example with requests still +in progress, risks leading to memory leaks or unexpected behavior. Almost all the resources emit `ErrorEvent` in case of errors.
All the other events are specific for the given resource and documented in the