ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/libev/ev.c
(Generate patch)

Comparing libev/ev.c (file contents):
Revision 1.361 by root, Sun Oct 24 19:01:01 2010 UTC vs.
Revision 1.364 by root, Sun Oct 24 21:51:03 2010 UTC

1736void 1736void
1737ev_loop_destroy (EV_P) 1737ev_loop_destroy (EV_P)
1738{ 1738{
1739 int i; 1739 int i;
1740 1740
1741#if EV_MULTIPLICITY
1742 /* mimic free (0) */
1743 if (!EV_A)
1744 return;
1745#endif
1746
1741#if EV_CLEANUP_ENABLE 1747#if EV_CLEANUP_ENABLE
1742 /* queue cleanup watchers (and execute them) */ 1748 /* queue cleanup watchers (and execute them) */
1743 if (expect_false (cleanupcnt)) 1749 if (expect_false (cleanupcnt))
1744 { 1750 {
1745 queue_events (EV_A_ (W *)cleanups, cleanupcnt, EV_CLEANUP); 1751 queue_events (EV_A_ (W *)cleanups, cleanupcnt, EV_CLEANUP);
3592 3598
3593 ev_start (EV_A_ (W)w, ++cleanupcnt); 3599 ev_start (EV_A_ (W)w, ++cleanupcnt);
3594 array_needsize (ev_cleanup *, cleanups, cleanupmax, cleanupcnt, EMPTY2); 3600 array_needsize (ev_cleanup *, cleanups, cleanupmax, cleanupcnt, EMPTY2);
3595 cleanups [cleanupcnt - 1] = w; 3601 cleanups [cleanupcnt - 1] = w;
3596 3602
3603 /* cleanup watchers should never keep a refcount on the loop */
3604 ev_unref (EV_A);
3597 EV_FREQUENT_CHECK; 3605 EV_FREQUENT_CHECK;
3598} 3606}
3599 3607
3600void 3608void
3601ev_cleanup_stop (EV_P_ ev_cleanup *w) 3609ev_cleanup_stop (EV_P_ ev_cleanup *w)
3603 clear_pending (EV_A_ (W)w); 3611 clear_pending (EV_A_ (W)w);
3604 if (expect_false (!ev_is_active (w))) 3612 if (expect_false (!ev_is_active (w)))
3605 return; 3613 return;
3606 3614
3607 EV_FREQUENT_CHECK; 3615 EV_FREQUENT_CHECK;
3616 ev_ref (EV_A);
3608 3617
3609 { 3618 {
3610 int active = ev_active (w); 3619 int active = ev_active (w);
3611 3620
3612 cleanups [active - 1] = cleanups [--cleanupcnt]; 3621 cleanups [active - 1] = cleanups [--cleanupcnt];

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines