ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/EV/EV.xs
(Generate patch)

Comparing EV/EV.xs (file contents):
Revision 1.33 by root, Thu Nov 1 11:55:54 2007 UTC vs.
Revision 1.34 by root, Thu Nov 1 12:11:07 2007 UTC

81 w->fh = 0; 81 w->fh = 0;
82 w->cb_sv = newSVsv (cb_sv); 82 w->cb_sv = newSVsv (cb_sv);
83 w->self = self; 83 w->self = self;
84 84
85 return (void *)w; 85 return (void *)w;
86}
87
88static void *
89e_destroy (void *w_)
90{
91 struct ev_watcher *w = w_;
92
93 SvREFCNT_dec (w->fh ); w->fh = 0;
94 SvREFCNT_dec (w->cb_sv); w->cb_sv = 0;
86} 95}
87 96
88static SV * 97static SV *
89e_bless (struct ev_watcher *w, HV *stash) 98e_bless (struct ev_watcher *w, HV *stash)
90{ 99{
438void ev_io_stop (struct ev_io *w) 447void ev_io_stop (struct ev_io *w)
439 448
440void DESTROY (struct ev_io *w) 449void DESTROY (struct ev_io *w)
441 CODE: 450 CODE:
442 ev_io_stop (w); 451 ev_io_stop (w);
452 e_destroy (w);
443 453
444void set (struct ev_io *w, SV *fh, int events) 454void set (struct ev_io *w, SV *fh, int events)
445 CODE: 455 CODE:
446{ 456{
447 int active = w->active; 457 int active = w->active;
500void ev_signal_stop (struct ev_signal *w) 510void ev_signal_stop (struct ev_signal *w)
501 511
502void DESTROY (struct ev_signal *w) 512void DESTROY (struct ev_signal *w)
503 CODE: 513 CODE:
504 ev_signal_stop (w); 514 ev_signal_stop (w);
515 e_destroy (w);
505 516
506void set (struct ev_signal *w, SV *signal = 0) 517void set (struct ev_signal *w, SV *signal = 0)
507 CODE: 518 CODE:
508{ 519{
509 Signal signum = sv_signum (signal); /* may croak here */ 520 Signal signum = sv_signum (signal); /* may croak here */
529 CHECK_REPEAT (w->repeat); 540 CHECK_REPEAT (w->repeat);
530 541
531void DESTROY (struct ev_timer *w) 542void DESTROY (struct ev_timer *w)
532 CODE: 543 CODE:
533 ev_timer_stop (w); 544 ev_timer_stop (w);
545 e_destroy (w);
534 546
535void set (struct ev_timer *w, NV after, NV repeat = 0.) 547void set (struct ev_timer *w, NV after, NV repeat = 0.)
536 INIT: 548 INIT:
537 CHECK_REPEAT (repeat); 549 CHECK_REPEAT (repeat);
538 CODE: 550 CODE:
552void ev_periodic_stop (struct ev_periodic *w) 564void ev_periodic_stop (struct ev_periodic *w)
553 565
554void DESTROY (struct ev_periodic *w) 566void DESTROY (struct ev_periodic *w)
555 CODE: 567 CODE:
556 ev_periodic_stop (w); 568 ev_periodic_stop (w);
569 e_destroy (w);
557 570
558void set (struct ev_periodic *w, NV at, NV interval = 0.) 571void set (struct ev_periodic *w, NV at, NV interval = 0.)
559 INIT: 572 INIT:
560 CHECK_REPEAT (interval); 573 CHECK_REPEAT (interval);
561 CODE: 574 CODE:
573void ev_idle_stop (struct ev_idle *w) 586void ev_idle_stop (struct ev_idle *w)
574 587
575void DESTROY (struct ev_idle *w) 588void DESTROY (struct ev_idle *w)
576 CODE: 589 CODE:
577 ev_idle_stop (w); 590 ev_idle_stop (w);
591 e_destroy (w);
578 592
579MODULE = EV PACKAGE = EV::Prepare PREFIX = ev_check_ 593MODULE = EV PACKAGE = EV::Prepare PREFIX = ev_check_
580 594
581void ev_prepare_start (struct ev_prepare *w) 595void ev_prepare_start (struct ev_prepare *w)
582 596
583void ev_prepare_stop (struct ev_prepare *w) 597void ev_prepare_stop (struct ev_prepare *w)
584 598
585void DESTROY (struct ev_prepare *w) 599void DESTROY (struct ev_prepare *w)
586 CODE: 600 CODE:
587 ev_prepare_stop (w); 601 ev_prepare_stop (w);
602 e_destroy (w);
588 603
589MODULE = EV PACKAGE = EV::Check PREFIX = ev_check_ 604MODULE = EV PACKAGE = EV::Check PREFIX = ev_check_
590 605
591void ev_check_start (struct ev_check *w) 606void ev_check_start (struct ev_check *w)
592 607
593void ev_check_stop (struct ev_check *w) 608void ev_check_stop (struct ev_check *w)
594 609
595void DESTROY (struct ev_check *w) 610void DESTROY (struct ev_check *w)
596 CODE: 611 CODE:
597 ev_check_stop (w); 612 ev_check_stop (w);
613 e_destroy (w);
598 614
599MODULE = EV PACKAGE = EV::Child PREFIX = ev_child_ 615MODULE = EV PACKAGE = EV::Child PREFIX = ev_child_
600 616
601void ev_child_start (struct ev_child *w) 617void ev_child_start (struct ev_child *w)
602 618
603void ev_child_stop (struct ev_child *w) 619void ev_child_stop (struct ev_child *w)
604 620
605void DESTROY (struct ev_child *w) 621void DESTROY (struct ev_child *w)
606 CODE: 622 CODE:
607 ev_child_stop (w); 623 ev_child_stop (w);
624 e_destroy (w);
608 625
609void set (struct ev_child *w, int pid) 626void set (struct ev_child *w, int pid)
610 CODE: 627 CODE:
611{ 628{
612 int active = w->active; 629 int active = w->active;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines