From f6430ac1e32e77870cd7a10c1e788c217afc621e Mon Sep 17 00:00:00 2001 From: Evan Jones Date: Tue, 8 Dec 2009 17:02:24 -0500 Subject: [PATCH] Update sample/signal-test.c to use newer APIs and not leak. --- sample/signal-test.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/sample/signal-test.c b/sample/signal-test.c index f6316839..e8e39de9 100644 --- a/sample/signal-test.c +++ b/sample/signal-test.c @@ -49,6 +49,7 @@ int main (int argc, char **argv) { struct event signal_int; + struct event_base* base; #ifdef WIN32 WORD wVersionRequested; WSADATA wsaData; @@ -60,15 +61,16 @@ main (int argc, char **argv) #endif /* Initalize the event library */ - event_init(); + base = event_base_new(); /* Initalize one event */ - event_set(&signal_int, SIGINT, EV_SIGNAL|EV_PERSIST, signal_cb, + event_assign(&signal_int, base, SIGINT, EV_SIGNAL|EV_PERSIST, signal_cb, &signal_int); event_add(&signal_int, NULL); - event_dispatch(); + event_base_dispatch(base); + event_base_free(base); return (0); } -- 2.40.0