Fix for libevent 1.2 versions.

git-svn-id: file:///svn/unbound/trunk@916 be551aaa-1e26-0410-a405-d3ace91eadb9
This commit is contained in:
Wouter Wijngaards 2008-02-01 12:53:02 +00:00
parent da8ae735ce
commit 6ffe218762

View file

@ -129,10 +129,12 @@ comm_base_delete(struct comm_base* b)
{
if(!b)
return;
#ifdef HAVE_EVENT_BASE_FREE
/* only libevent 1.2+ has it */
#if defined(HAVE_EVENT_BASE_FREE) && defined(HAVE_EVENT_BASE_ONCE)
/* only libevent 1.2+ has it, but in 1.2 it is broken -
assertion fails on signal handling ev that is not deleted
in libevent 1.3c (event_base_once appears) this is fixed. */
event_base_free(b->eb->base);
#endif /* HAVE_EVENT_BASE_FREE */
#endif /* HAVE_EVENT_BASE_FREE and HAVE_EVENT_BASE_ONCE */
b->eb->base = NULL;
free(b->eb);
free(b);