--- cvsroot/EV/EV.xs 2007/11/08 00:44:17 1.59 +++ cvsroot/EV/EV.xs 2007/11/08 02:19:36 1.60 @@ -118,6 +118,7 @@ SvREFCNT_dec (w->fh ); w->fh = 0; SvREFCNT_dec (w->cb_sv); w->cb_sv = 0; + SvREFCNT_dec (w->data ); w->data = 0; } static SV * @@ -429,7 +430,7 @@ { struct ev_periodic *w; w = e_new (sizeof (struct ev_periodic), cb); - w->fh = SvOK (reschedule_cb) ? newSVsv (reschedule_cb) : 0; + w->fh = SvTRUE (reschedule_cb) ? newSVsv (reschedule_cb) : 0; ev_periodic_set (w, at, interval, w->fh ? e_periodic_cb : 0); RETVAL = e_bless ((struct ev_watcher *)w, stash_periodic); if (!ix) ev_periodic_start (w); @@ -504,6 +505,14 @@ } OUTPUT: RETVAL + +SV *data (struct ev_watcher *w, SV *new_data = 0) + CODE: +{ + RETVAL = w->data ? newSVsv (w->data) : &PL_sv_undef; +} + OUTPUT: + RETVAL void trigger (struct ev_watcher *w, int revents = EV_NONE) CODE: