I have a program which makes extensive use of timer and idle watchers
which have closures as callbacks.  Each of these closures contain references
to multiple objects, and as the program runs, I can see the memory usage
steadily climbing.  I'm pretty sure I've traced it down to the fact that
code refs for watcher callbacks are never freed.

The workaround I've found is to do $watcher->cb(sub {}) at the end of
the closure, or before cancelling the watcher, but I obviously haven't
found all the places to do that.

Is there a way to tell the watcher to free its cb and data when it's done?
ie. after a non-repeating timer or idle event has fired, or when the
watcher gets cancelled?

Thanks for your help.
-- Tony  [EMAIL PROTECTED]

Reply via email to