(Does this mailing list exist? My mail to [EMAIL PROTECTED] and
[EMAIL PROTECTED] doesn't return. Perhaps mail on perl.org
is just slow.)
The following program segfaults after one second (when the watcher
triggers):
use Event;
my $w = Event->timer(after => 1, cb => sub {});
$w->cb(undef);
Event::loop;
The problem is that watchers are not stopped when their callback is
removed. I am attaching a patch which appears to fix the problem.
- Damien
*** Event-0.81-orig/c/watcher.c Tue Jun 13 08:24:24 2000
--- Event-0.81/c/watcher.c Wed May 30 10:22:59 2001
***************
*** 90,95 ****
--- 90,96 ----
WaPERLCB_off(ev);
ev->callback = 0;
ev->ext_data = 0;
+ pe_watcher_stop(ev, 0);
} else if (SvROK(nval) && (SvTYPE(sv=SvRV(nval)) == SVt_PVCV)) {
WaPERLCB_on(ev);
ev->callback = SvREFCNT_inc(nval);