summaryrefslogtreecommitdiff
path: root/ev.pod
diff options
context:
space:
mode:
Diffstat (limited to 'ev.pod')
-rw-r--r--ev.pod5
1 files changed, 5 insertions, 0 deletions
diff --git a/ev.pod b/ev.pod
index 4d92b67..78d4d38 100644
--- a/ev.pod
+++ b/ev.pod
@@ -2883,7 +2883,12 @@ callback, free it. Also, use no error checking, as usual.
static void
idle_cb (struct ev_loop *loop, ev_idle *w, int revents)
{
+ // stop the watcher
+ ev_idle_stop (loop, w);
+
+ // now we can free it
free (w);
+
// now do something you wanted to do when the program has
// no longer anything immediate to do.
}